@whetstone-research/doppler-sdk 0.0.17 → 0.0.19

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.
Files changed (162) hide show
  1. package/README.md +66 -1
  2. package/dist/DopplerSDK.js +19 -19
  3. package/dist/DopplerSDK.mjs +18 -18
  4. package/dist/abis/index.d.mts +32 -1
  5. package/dist/abis/index.d.ts +32 -1
  6. package/dist/abis/index.js +26 -22
  7. package/dist/abis/index.mjs +1 -1
  8. package/dist/addresses.d.mts +1 -0
  9. package/dist/addresses.d.ts +1 -0
  10. package/dist/addresses.js +7 -7
  11. package/dist/addresses.mjs +2 -2
  12. package/dist/builders/DynamicAuctionBuilder.js +10 -10
  13. package/dist/builders/DynamicAuctionBuilder.mjs +9 -9
  14. package/dist/builders/MulticurveBuilder.d.mts +16 -0
  15. package/dist/builders/MulticurveBuilder.d.ts +16 -0
  16. package/dist/builders/MulticurveBuilder.js +10 -10
  17. package/dist/builders/MulticurveBuilder.mjs +9 -9
  18. package/dist/builders/StaticAuctionBuilder.js +10 -10
  19. package/dist/builders/StaticAuctionBuilder.mjs +9 -9
  20. package/dist/builders/index.js +18 -18
  21. package/dist/builders/index.mjs +11 -11
  22. package/dist/builders/shared.js +11 -11
  23. package/dist/builders/shared.mjs +7 -7
  24. package/dist/{chunk-LOVD3NCN.js → chunk-3MVW6UIW.js} +18 -2
  25. package/dist/chunk-3MVW6UIW.js.map +1 -0
  26. package/dist/{chunk-DVAQB7TB.mjs → chunk-3NFSMMBF.mjs} +3 -3
  27. package/dist/{chunk-DVAQB7TB.mjs.map → chunk-3NFSMMBF.mjs.map} +1 -1
  28. package/dist/{chunk-PBWOCVDZ.mjs → chunk-4TAAZ6W3.mjs} +248 -51
  29. package/dist/chunk-4TAAZ6W3.mjs.map +1 -0
  30. package/dist/{chunk-4DUE547M.js → chunk-6BQY5EPB.js} +4 -2
  31. package/dist/chunk-6BQY5EPB.js.map +1 -0
  32. package/dist/{chunk-HVM7KZJM.mjs → chunk-6HFZ6XMV.mjs} +4 -4
  33. package/dist/{chunk-HVM7KZJM.mjs.map → chunk-6HFZ6XMV.mjs.map} +1 -1
  34. package/dist/{chunk-EG6O2TUX.js → chunk-7Z2UGWE7.js} +26 -26
  35. package/dist/{chunk-EG6O2TUX.js.map → chunk-7Z2UGWE7.js.map} +1 -1
  36. package/dist/{chunk-O2DZH23A.mjs → chunk-CYY5IATT.mjs} +9 -5
  37. package/dist/chunk-CYY5IATT.mjs.map +1 -0
  38. package/dist/{chunk-BZKX3J3R.mjs → chunk-E2NF4AQB.mjs} +18 -3
  39. package/dist/chunk-E2NF4AQB.mjs.map +1 -0
  40. package/dist/{chunk-B4B7BXLI.js → chunk-E6ACC5S6.js} +24 -24
  41. package/dist/{chunk-B4B7BXLI.js.map → chunk-E6ACC5S6.js.map} +1 -1
  42. package/dist/{chunk-K5CV3MIH.mjs → chunk-FQ3PVXZU.mjs} +5 -5
  43. package/dist/{chunk-K5CV3MIH.mjs.map → chunk-FQ3PVXZU.mjs.map} +1 -1
  44. package/dist/{chunk-WQKBQRBS.mjs → chunk-GCT3IZ3E.mjs} +12 -12
  45. package/dist/{chunk-WQKBQRBS.mjs.map → chunk-GCT3IZ3E.mjs.map} +1 -1
  46. package/dist/{chunk-LDZCTC5Q.mjs → chunk-H5SUGQ2C.mjs} +45 -7
  47. package/dist/chunk-H5SUGQ2C.mjs.map +1 -0
  48. package/dist/{chunk-PE47QUJV.mjs → chunk-HH7HQ4HC.mjs} +3 -3
  49. package/dist/{chunk-PE47QUJV.mjs.map → chunk-HH7HQ4HC.mjs.map} +1 -1
  50. package/dist/{chunk-LXUF7RNX.mjs → chunk-IWJOPXYN.mjs} +4 -3
  51. package/dist/chunk-IWJOPXYN.mjs.map +1 -0
  52. package/dist/{chunk-MBOKYN2Y.js → chunk-K3TEDYUG.js} +20 -20
  53. package/dist/{chunk-MBOKYN2Y.js.map → chunk-K3TEDYUG.js.map} +1 -1
  54. package/dist/{chunk-NVVEUALG.mjs → chunk-MH74WYVZ.mjs} +5 -5
  55. package/dist/{chunk-NVVEUALG.mjs.map → chunk-MH74WYVZ.mjs.map} +1 -1
  56. package/dist/{chunk-ZVH7VBH5.mjs → chunk-N74ICDSX.mjs} +118 -20
  57. package/dist/chunk-N74ICDSX.mjs.map +1 -0
  58. package/dist/{chunk-C7GN6GPG.js → chunk-OROTK4OT.js} +51 -27
  59. package/dist/chunk-OROTK4OT.js.map +1 -0
  60. package/dist/{chunk-Z7ZGPSQF.js → chunk-P4BT5GDO.js} +76 -72
  61. package/dist/chunk-P4BT5GDO.js.map +1 -0
  62. package/dist/{chunk-YBDWQTUH.mjs → chunk-QFQXHDC7.mjs} +76 -9
  63. package/dist/chunk-QFQXHDC7.mjs.map +1 -0
  64. package/dist/{chunk-RKJ2466C.mjs → chunk-QOGBOT2M.mjs} +3 -3
  65. package/dist/{chunk-RKJ2466C.mjs.map → chunk-QOGBOT2M.mjs.map} +1 -1
  66. package/dist/{chunk-3ALNQHGL.js → chunk-RLUMYHPI.js} +76 -9
  67. package/dist/chunk-RLUMYHPI.js.map +1 -0
  68. package/dist/{chunk-5FJCRKQ6.js → chunk-RXUJ4DUB.js} +28 -28
  69. package/dist/{chunk-5FJCRKQ6.js.map → chunk-RXUJ4DUB.js.map} +1 -1
  70. package/dist/{chunk-MGLI4N4B.js → chunk-SAX7P3MH.js} +22 -22
  71. package/dist/{chunk-MGLI4N4B.js.map → chunk-SAX7P3MH.js.map} +1 -1
  72. package/dist/{chunk-3ORKVXQL.js → chunk-TJCMFITE.js} +27 -27
  73. package/dist/{chunk-3ORKVXQL.js.map → chunk-TJCMFITE.js.map} +1 -1
  74. package/dist/{chunk-TL7U67CX.js → chunk-UIPSHVT4.js} +11 -11
  75. package/dist/{chunk-TL7U67CX.js.map → chunk-UIPSHVT4.js.map} +1 -1
  76. package/dist/{chunk-5ZPBKSNS.mjs → chunk-UY4TVYEU.mjs} +3 -3
  77. package/dist/{chunk-5ZPBKSNS.mjs.map → chunk-UY4TVYEU.mjs.map} +1 -1
  78. package/dist/{chunk-PQUS2LCD.js → chunk-UZTVXZP3.js} +16 -16
  79. package/dist/{chunk-PQUS2LCD.js.map → chunk-UZTVXZP3.js.map} +1 -1
  80. package/dist/{chunk-HMZEYBFO.mjs → chunk-V32Q2S3U.mjs} +4 -4
  81. package/dist/{chunk-HMZEYBFO.mjs.map → chunk-V32Q2S3U.mjs.map} +1 -1
  82. package/dist/{chunk-7F4O7NPS.js → chunk-V5GPJ6S2.js} +26 -26
  83. package/dist/{chunk-7F4O7NPS.js.map → chunk-V5GPJ6S2.js.map} +1 -1
  84. package/dist/{chunk-DOWDXOTK.mjs → chunk-VGCXJRUV.mjs} +51 -27
  85. package/dist/chunk-VGCXJRUV.mjs.map +1 -0
  86. package/dist/{chunk-J32XSN44.js → chunk-WYRM5BAI.js} +344 -147
  87. package/dist/chunk-WYRM5BAI.js.map +1 -0
  88. package/dist/{chunk-OUUFER2X.mjs → chunk-X7FRTHUL.mjs} +4 -4
  89. package/dist/{chunk-OUUFER2X.mjs.map → chunk-X7FRTHUL.mjs.map} +1 -1
  90. package/dist/{chunk-E54BP2GN.js → chunk-Y6VZD4C6.js} +53 -15
  91. package/dist/chunk-Y6VZD4C6.js.map +1 -0
  92. package/dist/{chunk-5MP6AMPB.js → chunk-YFJUIO2A.js} +132 -34
  93. package/dist/chunk-YFJUIO2A.js.map +1 -0
  94. package/dist/{chunk-WHQHXYPB.js → chunk-YKRDFXU3.js} +5 -5
  95. package/dist/{chunk-WHQHXYPB.js.map → chunk-YKRDFXU3.js.map} +1 -1
  96. package/dist/constants.d.mts +7 -1
  97. package/dist/constants.d.ts +7 -1
  98. package/dist/constants.js +51 -47
  99. package/dist/constants.mjs +1 -1
  100. package/dist/deployments.generated.d.mts +72 -5
  101. package/dist/deployments.generated.d.ts +72 -5
  102. package/dist/deployments.generated.js +2 -2
  103. package/dist/deployments.generated.mjs +1 -1
  104. package/dist/entities/DopplerFactory.d.mts +2 -0
  105. package/dist/entities/DopplerFactory.d.ts +2 -0
  106. package/dist/entities/DopplerFactory.js +8 -8
  107. package/dist/entities/DopplerFactory.mjs +7 -7
  108. package/dist/entities/auction/DynamicAuction.js +5 -5
  109. package/dist/entities/auction/DynamicAuction.mjs +4 -4
  110. package/dist/entities/auction/MulticurvePool.d.mts +9 -3
  111. package/dist/entities/auction/MulticurvePool.d.ts +9 -3
  112. package/dist/entities/auction/MulticurvePool.js +7 -6
  113. package/dist/entities/auction/MulticurvePool.mjs +6 -5
  114. package/dist/entities/auction/StaticAuction.js +5 -5
  115. package/dist/entities/auction/StaticAuction.mjs +4 -4
  116. package/dist/entities/auction/index.js +11 -10
  117. package/dist/entities/auction/index.mjs +8 -7
  118. package/dist/entities/quoter/Quoter.js +5 -5
  119. package/dist/entities/quoter/Quoter.mjs +4 -4
  120. package/dist/entities/quoter/index.js +5 -5
  121. package/dist/entities/quoter/index.mjs +4 -4
  122. package/dist/entities/token/derc20/Derc20.js +3 -3
  123. package/dist/entities/token/derc20/Derc20.mjs +2 -2
  124. package/dist/entities/token/derc20/index.js +3 -3
  125. package/dist/entities/token/derc20/index.mjs +2 -2
  126. package/dist/entities/token/index.js +3 -3
  127. package/dist/entities/token/index.mjs +2 -2
  128. package/dist/index.d.mts +3 -3
  129. package/dist/index.d.ts +3 -3
  130. package/dist/index.js +110 -102
  131. package/dist/index.js.map +1 -1
  132. package/dist/index.mjs +18 -18
  133. package/dist/index.mjs.map +1 -1
  134. package/dist/types.d.mts +32 -1
  135. package/dist/types.d.ts +32 -1
  136. package/dist/types.js +8 -8
  137. package/dist/types.mjs +3 -3
  138. package/dist/utils/airlock.js +7 -7
  139. package/dist/utils/airlock.mjs +3 -3
  140. package/dist/utils/index.js +10 -10
  141. package/dist/utils/index.mjs +5 -5
  142. package/dist/utils/tokenAddressMiner.d.mts +7 -0
  143. package/dist/utils/tokenAddressMiner.d.ts +7 -0
  144. package/dist/utils/tokenAddressMiner.js +3 -3
  145. package/dist/utils/tokenAddressMiner.mjs +2 -2
  146. package/package.json +1 -1
  147. package/dist/chunk-3ALNQHGL.js.map +0 -1
  148. package/dist/chunk-4DUE547M.js.map +0 -1
  149. package/dist/chunk-5MP6AMPB.js.map +0 -1
  150. package/dist/chunk-BZKX3J3R.mjs.map +0 -1
  151. package/dist/chunk-C7GN6GPG.js.map +0 -1
  152. package/dist/chunk-DOWDXOTK.mjs.map +0 -1
  153. package/dist/chunk-E54BP2GN.js.map +0 -1
  154. package/dist/chunk-J32XSN44.js.map +0 -1
  155. package/dist/chunk-LDZCTC5Q.mjs.map +0 -1
  156. package/dist/chunk-LOVD3NCN.js.map +0 -1
  157. package/dist/chunk-LXUF7RNX.mjs.map +0 -1
  158. package/dist/chunk-O2DZH23A.mjs.map +0 -1
  159. package/dist/chunk-PBWOCVDZ.mjs.map +0 -1
  160. package/dist/chunk-YBDWQTUH.mjs.map +0 -1
  161. package/dist/chunk-Z7ZGPSQF.js.map +0 -1
  162. package/dist/chunk-ZVH7VBH5.mjs.map +0 -1
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkMGLI4N4B_js = require('./chunk-MGLI4N4B.js');
3
+ var chunkSAX7P3MH_js = require('./chunk-SAX7P3MH.js');
4
4
  var chunkN33R22A2_js = require('./chunk-N33R22A2.js');
5
- var chunk4DUE547M_js = require('./chunk-4DUE547M.js');
6
- var chunkTL7U67CX_js = require('./chunk-TL7U67CX.js');
5
+ var chunk6BQY5EPB_js = require('./chunk-6BQY5EPB.js');
6
+ var chunkUIPSHVT4_js = require('./chunk-UIPSHVT4.js');
7
7
 
8
8
  // src/builders/StaticAuctionBuilder.ts
9
9
  var StaticAuctionBuilder = class _StaticAuctionBuilder {
@@ -28,7 +28,7 @@ var StaticAuctionBuilder = class _StaticAuctionBuilder {
28
28
  name: params.name,
29
29
  symbol: params.symbol,
30
30
  tokenURI: params.tokenURI,
31
- yearlyMintRate: params.yearlyMintRate ?? chunk4DUE547M_js.DEFAULT_V3_YEARLY_MINT_RATE
31
+ yearlyMintRate: params.yearlyMintRate ?? chunk6BQY5EPB_js.DEFAULT_V3_YEARLY_MINT_RATE
32
32
  };
33
33
  }
34
34
  return this;
@@ -54,20 +54,20 @@ var StaticAuctionBuilder = class _StaticAuctionBuilder {
54
54
  "Cannot use poolByTicks() after withMarketCapRange(). Use withMarketCapRange() for market cap-based configuration, or poolByTicks()/poolByPriceRange() for manual tick configuration."
55
55
  );
56
56
  }
57
- const fee = params.fee ?? chunk4DUE547M_js.DEFAULT_V3_FEE;
58
- if (!chunk4DUE547M_js.V3_FEE_TIERS.includes(fee)) {
57
+ const fee = params.fee ?? chunk6BQY5EPB_js.DEFAULT_V3_FEE;
58
+ if (!chunk6BQY5EPB_js.V3_FEE_TIERS.includes(fee)) {
59
59
  throw new Error(
60
- `Static auctions (Uniswap V3) require standard fee tiers: ${chunk4DUE547M_js.V3_FEE_TIERS.join(", ")}. Got: ${fee}. For custom fees, use Dynamic or Multicurve auctions (Uniswap V4).`
60
+ `Static auctions (Uniswap V3) require standard fee tiers: ${chunk6BQY5EPB_js.V3_FEE_TIERS.join(", ")}. Got: ${fee}. For custom fees, use Dynamic or Multicurve auctions (Uniswap V4).`
61
61
  );
62
62
  }
63
- const startTick = params.startTick ?? chunk4DUE547M_js.DEFAULT_V3_START_TICK;
64
- const endTick = params.endTick ?? chunk4DUE547M_js.DEFAULT_V3_END_TICK;
63
+ const startTick = params.startTick ?? chunk6BQY5EPB_js.DEFAULT_V3_START_TICK;
64
+ const endTick = params.endTick ?? chunk6BQY5EPB_js.DEFAULT_V3_END_TICK;
65
65
  this.pool = {
66
66
  startTick,
67
67
  endTick,
68
68
  fee,
69
- numPositions: params.numPositions ?? chunk4DUE547M_js.DEFAULT_V3_NUM_POSITIONS,
70
- maxShareToBeSold: params.maxShareToBeSold ?? chunk4DUE547M_js.DEFAULT_V3_MAX_SHARE_TO_BE_SOLD
69
+ numPositions: params.numPositions ?? chunk6BQY5EPB_js.DEFAULT_V3_NUM_POSITIONS,
70
+ maxShareToBeSold: params.maxShareToBeSold ?? chunk6BQY5EPB_js.DEFAULT_V3_MAX_SHARE_TO_BE_SOLD
71
71
  };
72
72
  return this;
73
73
  }
@@ -80,9 +80,9 @@ var StaticAuctionBuilder = class _StaticAuctionBuilder {
80
80
  "Cannot use poolByPriceRange() after withMarketCapRange(). Use withMarketCapRange() for market cap-based configuration, or poolByTicks()/poolByPriceRange() for manual tick configuration."
81
81
  );
82
82
  }
83
- const fee = params.fee ?? chunk4DUE547M_js.DEFAULT_V3_FEE;
84
- const tickSpacing = fee === 100 ? chunk4DUE547M_js.TICK_SPACINGS[100] : fee === 500 ? chunk4DUE547M_js.TICK_SPACINGS[500] : fee === 3e3 ? chunk4DUE547M_js.TICK_SPACINGS[3e3] : chunk4DUE547M_js.TICK_SPACINGS[1e4];
85
- const ticks = chunkMGLI4N4B_js.computeTicks(params.priceRange, tickSpacing);
83
+ const fee = params.fee ?? chunk6BQY5EPB_js.DEFAULT_V3_FEE;
84
+ const tickSpacing = fee === 100 ? chunk6BQY5EPB_js.TICK_SPACINGS[100] : fee === 500 ? chunk6BQY5EPB_js.TICK_SPACINGS[500] : fee === 3e3 ? chunk6BQY5EPB_js.TICK_SPACINGS[3e3] : chunk6BQY5EPB_js.TICK_SPACINGS[1e4];
85
+ const ticks = chunkSAX7P3MH_js.computeTicks(params.priceRange, tickSpacing);
86
86
  return this.poolByTicks({
87
87
  startTick: ticks.startTick,
88
88
  endTick: ticks.endTick,
@@ -124,9 +124,9 @@ var StaticAuctionBuilder = class _StaticAuctionBuilder {
124
124
  throw new Error("marketCap.start must be less than marketCap.end");
125
125
  }
126
126
  if (params.fee !== void 0) {
127
- if (!chunk4DUE547M_js.V3_FEE_TIERS.includes(params.fee)) {
127
+ if (!chunk6BQY5EPB_js.V3_FEE_TIERS.includes(params.fee)) {
128
128
  throw new Error(
129
- `Static auctions (Uniswap V3) require standard fee tiers: ${chunk4DUE547M_js.V3_FEE_TIERS.join(", ")}. Got: ${params.fee}. For custom fees, use Dynamic or Multicurve auctions (Uniswap V4).`
129
+ `Static auctions (Uniswap V3) require standard fee tiers: ${chunk6BQY5EPB_js.V3_FEE_TIERS.join(", ")}. Got: ${params.fee}. For custom fees, use Dynamic or Multicurve auctions (Uniswap V4).`
130
130
  );
131
131
  }
132
132
  }
@@ -179,7 +179,7 @@ var StaticAuctionBuilder = class _StaticAuctionBuilder {
179
179
  return this;
180
180
  }
181
181
  this.vesting = {
182
- duration: Number(params.duration ?? chunk4DUE547M_js.DEFAULT_V3_VESTING_DURATION),
182
+ duration: Number(params.duration ?? chunk6BQY5EPB_js.DEFAULT_V3_VESTING_DURATION),
183
183
  cliffDuration: params.cliffDuration ?? 0,
184
184
  recipients: params.recipients,
185
185
  amounts: params.amounts
@@ -199,7 +199,7 @@ var StaticAuctionBuilder = class _StaticAuctionBuilder {
199
199
  return this;
200
200
  }
201
201
  withIntegrator(address) {
202
- this.integrator = address ?? chunk4DUE547M_js.ZERO_ADDRESS;
202
+ this.integrator = address ?? chunk6BQY5EPB_js.ZERO_ADDRESS;
203
203
  return this;
204
204
  }
205
205
  withGasLimit(gas) {
@@ -248,8 +248,8 @@ var StaticAuctionBuilder = class _StaticAuctionBuilder {
248
248
  "tokenSupply must be provided (either via saleConfig() or withMarketCapRange() params)"
249
249
  );
250
250
  }
251
- const fee = config.fee ?? chunk4DUE547M_js.DEFAULT_V3_FEE;
252
- const tickSpacing = fee === 100 ? chunk4DUE547M_js.TICK_SPACINGS[100] : fee === 500 ? chunk4DUE547M_js.TICK_SPACINGS[500] : fee === 3e3 ? chunk4DUE547M_js.TICK_SPACINGS[3e3] : chunk4DUE547M_js.TICK_SPACINGS[1e4];
251
+ const fee = config.fee ?? chunk6BQY5EPB_js.DEFAULT_V3_FEE;
252
+ const tickSpacing = fee === 100 ? chunk6BQY5EPB_js.TICK_SPACINGS[100] : fee === 500 ? chunk6BQY5EPB_js.TICK_SPACINGS[500] : fee === 3e3 ? chunk6BQY5EPB_js.TICK_SPACINGS[3e3] : chunk6BQY5EPB_js.TICK_SPACINGS[1e4];
253
253
  const startValidation = chunkN33R22A2_js.validateMarketCapParameters(
254
254
  config.marketCap.start,
255
255
  tokenSupply,
@@ -280,13 +280,13 @@ var StaticAuctionBuilder = class _StaticAuctionBuilder {
280
280
  startTick,
281
281
  endTick,
282
282
  fee,
283
- numPositions: config.numPositions ?? chunk4DUE547M_js.DEFAULT_V3_NUM_POSITIONS,
284
- maxShareToBeSold: config.maxShareToBeSold ?? chunk4DUE547M_js.DEFAULT_V3_MAX_SHARE_TO_BE_SOLD
283
+ numPositions: config.numPositions ?? chunk6BQY5EPB_js.DEFAULT_V3_NUM_POSITIONS,
284
+ maxShareToBeSold: config.maxShareToBeSold ?? chunk6BQY5EPB_js.DEFAULT_V3_MAX_SHARE_TO_BE_SOLD
285
285
  };
286
286
  }
287
287
  if (!this.pool) throw new Error("pool configuration is required");
288
- const governance = this.governance ?? (chunkTL7U67CX_js.isNoOpEnabledChain(this.chainId) ? { type: "noOp" } : { type: "default" });
289
- if (governance.type === "launchpad" && !chunkTL7U67CX_js.isLaunchpadEnabledChain(this.chainId)) {
288
+ const governance = this.governance ?? (chunkUIPSHVT4_js.isNoOpEnabledChain(this.chainId) ? { type: "noOp" } : { type: "default" });
289
+ if (governance.type === "launchpad" && !chunkUIPSHVT4_js.isLaunchpadEnabledChain(this.chainId)) {
290
290
  throw new Error(
291
291
  `Launchpad governance is not supported on chain ${this.chainId}. Use a supported chain or a different governance type.`
292
292
  );
@@ -307,7 +307,7 @@ var StaticAuctionBuilder = class _StaticAuctionBuilder {
307
307
  vesting: this.vesting,
308
308
  governance,
309
309
  migration: this.migration,
310
- integrator: this.integrator ?? chunk4DUE547M_js.ZERO_ADDRESS,
310
+ integrator: this.integrator ?? chunk6BQY5EPB_js.ZERO_ADDRESS,
311
311
  userAddress: this.userAddress,
312
312
  modules: this.moduleAddresses,
313
313
  gas: this.gasLimit
@@ -316,5 +316,5 @@ var StaticAuctionBuilder = class _StaticAuctionBuilder {
316
316
  };
317
317
 
318
318
  exports.StaticAuctionBuilder = StaticAuctionBuilder;
319
- //# sourceMappingURL=chunk-3ORKVXQL.js.map
320
- //# sourceMappingURL=chunk-3ORKVXQL.js.map
319
+ //# sourceMappingURL=chunk-TJCMFITE.js.map
320
+ //# sourceMappingURL=chunk-TJCMFITE.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/builders/StaticAuctionBuilder.ts"],"names":["DEFAULT_V3_YEARLY_MINT_RATE","DEFAULT_V3_FEE","V3_FEE_TIERS","DEFAULT_V3_START_TICK","DEFAULT_V3_END_TICK","DEFAULT_V3_NUM_POSITIONS","DEFAULT_V3_MAX_SHARE_TO_BE_SOLD","TICK_SPACINGS","computeTicks","DEFAULT_V3_VESTING_DURATION","ZERO_ADDRESS","validateMarketCapParameters","marketCapToTicksForStaticAuction","isNoOpEnabledChain","isLaunchpadEnabledChain"],"mappings":";;;;;;;;AAgCO,IAAM,oBAAA,GAAN,MAAM,qBAAA,CAEsB;AAAA,EAyBjC,YAAY,OAAA,EAAY;AACtB,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AAAA,EACjB;AAAA,EAEA,OAAO,SACL,OAAA,EACyB;AACzB,IAAA,OAAO,IAAI,sBAAqB,OAAO,CAAA;AAAA,EACzC;AAAA,EAEA,YACE,MAAA,EAeM;AACN,IAAA,IAAI,MAAA,IAAU,MAAA,IAAU,MAAA,IAAU,MAAA,CAAO,SAAS,YAAA,EAAc;AAC9D,MAAA,IAAA,CAAK,KAAA,GAAQ;AAAA,QACX,IAAA,EAAM,YAAA;AAAA,QACN,MAAM,MAAA,CAAO,IAAA;AAAA,QACb,QAAQ,MAAA,CAAO,MAAA;AAAA,QACf,SAAS,MAAA,CAAO,OAAA;AAAA,QAChB,MAAM,MAAA,CAAO;AAAA,OACf;AAAA,IACF,CAAA,MAAO;AACL,MAAA,IAAA,CAAK,KAAA,GAAQ;AAAA,QACX,IAAA,EAAM,UAAA;AAAA,QACN,MAAM,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AAO,IAAA,CAAK,KAAA;AAAA,MACZ,MAAM,IAAA,CAAK,IAAA;AAAA,MACX,IAAA,EAAM,qBAAA;AAAA,MACN,SAAS,IAAA,CAAK,OAAA;AAAA,MACd,UAAA;AAAA,MACA,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,UAAA,EAAY,KAAK,UAAA,IAAcJ,6BAAA;AAAA,MAC/B,aAAa,IAAA,CAAK,WAAA;AAAA,MAClB,SAAS,IAAA,CAAK,eAAA;AAAA,MACd,KAAK,IAAA,CAAK;AAAA,KACZ;AAAA,EACF;AACF","file":"chunk-3ORKVXQL.js","sourcesContent":["import type { Address } from 'viem';\nimport {\n DEFAULT_V3_END_TICK,\n DEFAULT_V3_FEE,\n DEFAULT_V3_MAX_SHARE_TO_BE_SOLD,\n DEFAULT_V3_NUM_POSITIONS,\n DEFAULT_V3_START_TICK,\n DEFAULT_V3_VESTING_DURATION,\n DEFAULT_V3_YEARLY_MINT_RATE,\n TICK_SPACINGS,\n V3_FEE_TIERS,\n ZERO_ADDRESS,\n} from '../constants';\nimport {\n marketCapToTicksForStaticAuction,\n validateMarketCapParameters,\n} from '../utils';\nimport {\n isNoOpEnabledChain,\n isLaunchpadEnabledChain,\n type CreateStaticAuctionParams,\n type GovernanceOption,\n type MigrationConfig,\n type PriceRange,\n type VestingConfig,\n type TokenConfig,\n type StaticAuctionMarketCapConfig,\n type ModuleAddressOverrides,\n} from '../types';\nimport { type SupportedChainId } from '../addresses';\nimport { computeTicks, type BaseAuctionBuilder } from './shared';\n\nexport class StaticAuctionBuilder<\n C extends SupportedChainId,\n> implements BaseAuctionBuilder<C> {\n private token?: TokenConfig;\n private sale?: CreateStaticAuctionParams<C>['sale'];\n private pool?: CreateStaticAuctionParams<C>['pool'];\n private beneficiaries?: { beneficiary: Address; shares: bigint }[];\n private vesting?: VestingConfig;\n private governance?: GovernanceOption<C>;\n private migration?: MigrationConfig;\n private integrator?: Address;\n private userAddress?: Address;\n private moduleAddresses?: ModuleAddressOverrides;\n private gasLimit?: bigint;\n // Deferred market cap config - converted to pool in build()\n private marketCapConfig?: {\n marketCap: { start: number; end: number };\n numerairePrice: number;\n tokenSupply?: bigint;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n fee?: number;\n numPositions?: number;\n maxShareToBeSold?: bigint;\n };\n public chainId: C;\n\n constructor(chainId: C) {\n this.chainId = chainId;\n }\n\n static forChain<C extends SupportedChainId>(\n chainId: C,\n ): StaticAuctionBuilder<C> {\n return new StaticAuctionBuilder(chainId);\n }\n\n tokenConfig(\n params:\n | {\n type?: 'standard';\n name: string;\n symbol: string;\n tokenURI: string;\n yearlyMintRate?: bigint;\n }\n | {\n type: 'doppler404';\n name: string;\n symbol: string;\n baseURI: string;\n unit?: bigint;\n },\n ): this {\n if (params && 'type' in params && params.type === 'doppler404') {\n this.token = {\n type: 'doppler404',\n name: params.name,\n symbol: params.symbol,\n baseURI: params.baseURI,\n unit: params.unit,\n };\n } else {\n this.token = {\n type: 'standard',\n name: params.name,\n symbol: params.symbol,\n tokenURI: params.tokenURI,\n yearlyMintRate: params.yearlyMintRate ?? DEFAULT_V3_YEARLY_MINT_RATE,\n };\n }\n return this;\n }\n\n saleConfig(params: {\n initialSupply: bigint;\n numTokensToSell: bigint;\n numeraire: Address;\n }): this {\n this.sale = {\n initialSupply: params.initialSupply,\n numTokensToSell: params.numTokensToSell,\n numeraire: params.numeraire,\n };\n return this;\n }\n\n /**\n * Provide pool ticks directly.\n *\n * Note: Static Auctions use Uniswap V3, which only supports 4 fee tiers:\n * 100 (0.01%), 500 (0.05%), 3000 (0.3%), 10000 (1%).\n * For custom fees, use Dynamic or Multicurve auctions (V4).\n */\n poolByTicks(params: {\n startTick?: number;\n endTick?: number;\n fee?: number;\n numPositions?: number;\n maxShareToBeSold?: bigint;\n }): this {\n // Mutual exclusion: cannot use poolByTicks() after withMarketCapRange()\n if (this.marketCapConfig) {\n throw new Error(\n 'Cannot use poolByTicks() after withMarketCapRange(). ' +\n 'Use withMarketCapRange() for market cap-based configuration, ' +\n 'or poolByTicks()/poolByPriceRange() for manual tick configuration.',\n );\n }\n\n const fee = params.fee ?? DEFAULT_V3_FEE;\n\n // Validate fee is a V3-supported tier\n if (!(V3_FEE_TIERS as readonly number[]).includes(fee)) {\n throw new Error(\n `Static auctions (Uniswap V3) require standard fee tiers: ${V3_FEE_TIERS.join(', ')}. ` +\n `Got: ${fee}. For custom fees, use Dynamic or Multicurve auctions (Uniswap V4).`,\n );\n }\n\n const startTick = params.startTick ?? DEFAULT_V3_START_TICK;\n const endTick = params.endTick ?? DEFAULT_V3_END_TICK;\n this.pool = {\n startTick,\n endTick,\n fee,\n numPositions: params.numPositions ?? DEFAULT_V3_NUM_POSITIONS,\n maxShareToBeSold:\n params.maxShareToBeSold ?? DEFAULT_V3_MAX_SHARE_TO_BE_SOLD,\n };\n return this;\n }\n\n /**\n * @deprecated Use withMarketCapRange() instead for more intuitive market cap configuration\n */\n poolByPriceRange(params: {\n priceRange: PriceRange;\n fee?: number;\n numPositions?: number;\n maxShareToBeSold?: bigint;\n }): this {\n // Mutual exclusion: cannot use poolByPriceRange() after withMarketCapRange()\n if (this.marketCapConfig) {\n throw new Error(\n 'Cannot use poolByPriceRange() after withMarketCapRange(). ' +\n 'Use withMarketCapRange() for market cap-based configuration, ' +\n 'or poolByTicks()/poolByPriceRange() for manual tick configuration.',\n );\n }\n\n const fee = params.fee ?? DEFAULT_V3_FEE;\n const tickSpacing =\n fee === 100\n ? TICK_SPACINGS[100]\n : fee === 500\n ? TICK_SPACINGS[500]\n : fee === 3000\n ? TICK_SPACINGS[3000]\n : TICK_SPACINGS[10000];\n const ticks = computeTicks(params.priceRange, tickSpacing);\n return this.poolByTicks({\n startTick: ticks.startTick,\n endTick: ticks.endTick,\n fee,\n numPositions: params.numPositions,\n maxShareToBeSold: params.maxShareToBeSold,\n });\n }\n\n /**\n * Configure pool using target market cap range.\n * Converts market cap values (in USD) to Uniswap ticks.\n *\n * @param params - Market cap configuration\n * @returns Builder instance for chaining\n *\n * @example\n * ```ts\n * builder\n * .saleConfig({ initialSupply, numTokensToSell, numeraire: WETH })\n * .withMarketCapRange({\n * marketCap: { start: 100_000, end: 10_000_000 }, // $100k to $10M\n * numerairePrice: 3000, // ETH = $3000\n * })\n * ```\n */\n withMarketCapRange(params: StaticAuctionMarketCapConfig): this {\n // Mutual exclusion: cannot use withMarketCapRange() after poolByTicks()/poolByPriceRange()\n if (this.pool) {\n throw new Error(\n 'Cannot use withMarketCapRange() after poolByTicks()/poolByPriceRange(). ' +\n 'Use withMarketCapRange() for market cap-based configuration, ' +\n 'or poolByTicks()/poolByPriceRange() for manual tick configuration.',\n );\n }\n\n // Basic validation that doesn't require saleConfig\n if (params.numerairePrice <= 0) {\n throw new Error('numerairePrice must be greater than 0');\n }\n if (params.marketCap.start <= 0 || params.marketCap.end <= 0) {\n throw new Error('marketCap values must be greater than 0');\n }\n if (params.marketCap.start >= params.marketCap.end) {\n throw new Error('marketCap.start must be less than marketCap.end');\n }\n\n // Validate fee is a V3-supported tier (if provided)\n if (params.fee !== undefined) {\n if (!(V3_FEE_TIERS as readonly number[]).includes(params.fee)) {\n throw new Error(\n `Static auctions (Uniswap V3) require standard fee tiers: ${V3_FEE_TIERS.join(', ')}. ` +\n `Got: ${params.fee}. For custom fees, use Dynamic or Multicurve auctions (Uniswap V4).`,\n );\n }\n }\n\n // Store config for deferred conversion in build()\n this.marketCapConfig = {\n marketCap: params.marketCap,\n numerairePrice: params.numerairePrice,\n tokenSupply: params.tokenSupply,\n tokenDecimals: params.tokenDecimals,\n numeraireDecimals: params.numeraireDecimals,\n fee: params.fee,\n numPositions: params.numPositions,\n maxShareToBeSold: params.maxShareToBeSold,\n };\n\n return this;\n }\n\n /**\n * Configure beneficiaries for fee streaming on locked V3 pools.\n *\n * When beneficiaries are provided, the pool enters a \"Locked\" state where:\n * - Fees are collected and distributed to beneficiaries according to their shares\n * - Liquidity cannot be exited/migrated (pool stays locked permanently)\n * - Anyone can call collectFees() to distribute accumulated fees\n *\n * IMPORTANT:\n * - Shares must sum to exactly WAD (1e18 = 100%)\n * - Protocol owner (Airlock.owner()) must be included with at least 5% shares\n * - Beneficiaries will be automatically sorted by address (ascending)\n * - Use withMigration({ type: 'noOp' }) when using beneficiaries\n *\n * @example\n * ```typescript\n * builder.withBeneficiaries([\n * { beneficiary: protocolOwner, shares: parseEther('0.05') }, // 5% (minimum required)\n * { beneficiary: teamWallet, shares: parseEther('0.45') }, // 45%\n * { beneficiary: daoTreasury, shares: parseEther('0.50') }, // 50%\n * ])\n * ```\n */\n withBeneficiaries(\n beneficiaries: { beneficiary: Address; shares: bigint }[],\n ): this {\n // Sort beneficiaries by address (ascending) as required by the contract\n this.beneficiaries = [...beneficiaries].sort((a, b) => {\n const aAddr = a.beneficiary.toLowerCase();\n const bAddr = b.beneficiary.toLowerCase();\n return aAddr < bAddr ? -1 : aAddr > bAddr ? 1 : 0;\n });\n return this;\n }\n\n withVesting(params?: {\n duration?: bigint;\n cliffDuration?: number;\n recipients?: Address[];\n amounts?: bigint[];\n }): this {\n if (!params) {\n this.vesting = undefined;\n return this;\n }\n this.vesting = {\n duration: Number(params.duration ?? DEFAULT_V3_VESTING_DURATION),\n cliffDuration: params.cliffDuration ?? 0,\n recipients: params.recipients,\n amounts: params.amounts,\n };\n return this;\n }\n\n withGovernance(params: GovernanceOption<C>): this {\n this.governance = params;\n return this;\n }\n\n withMigration(migration: MigrationConfig): this {\n this.migration = migration;\n return this;\n }\n\n withUserAddress(address: Address): this {\n this.userAddress = address;\n return this;\n }\n\n withIntegrator(address?: Address): this {\n this.integrator = address ?? ZERO_ADDRESS;\n return this;\n }\n\n withGasLimit(gas?: bigint): this {\n this.gasLimit = gas;\n return this;\n }\n\n // Address override helpers\n private overrideModule<K extends keyof ModuleAddressOverrides>(\n key: K,\n address: NonNullable<ModuleAddressOverrides[K]>,\n ): this {\n this.moduleAddresses = {\n ...this.moduleAddresses,\n [key]: address,\n } as ModuleAddressOverrides;\n return this;\n }\n\n withTokenFactory(address: Address): this {\n return this.overrideModule('tokenFactory', address);\n }\n\n withAirlock(address: Address): this {\n return this.overrideModule('airlock', address);\n }\n\n withV3Initializer(address: Address): this {\n return this.overrideModule('v3Initializer', address);\n }\n\n withGovernanceFactory(address: Address): this {\n return this.overrideModule('governanceFactory', address);\n }\n\n withV2Migrator(address: Address): this {\n return this.overrideModule('v2Migrator', address);\n }\n\n withV4Migrator(address: Address): this {\n return this.overrideModule('v4Migrator', address);\n }\n\n withNoOpMigrator(address: Address): this {\n return this.overrideModule('noOpMigrator', address);\n }\n\n build(): CreateStaticAuctionParams<C> {\n if (!this.token) throw new Error('tokenConfig is required');\n if (!this.sale) throw new Error('saleConfig is required');\n if (!this.migration) throw new Error('migration configuration is required');\n if (!this.userAddress) throw new Error('userAddress is required');\n\n // Convert deferred market cap config to pool if set\n if (this.marketCapConfig && !this.pool) {\n const config = this.marketCapConfig;\n\n // Get token supply from config or saleConfig\n const tokenSupply = config.tokenSupply ?? this.sale.initialSupply;\n if (!tokenSupply) {\n throw new Error(\n 'tokenSupply must be provided (either via saleConfig() or withMarketCapRange() params)',\n );\n }\n\n // Determine fee and tick spacing\n const fee = config.fee ?? DEFAULT_V3_FEE;\n const tickSpacing =\n fee === 100\n ? TICK_SPACINGS[100]\n : fee === 500\n ? TICK_SPACINGS[500]\n : fee === 3000\n ? TICK_SPACINGS[3000]\n : TICK_SPACINGS[10000];\n\n // Validate market cap parameters\n const startValidation = validateMarketCapParameters(\n config.marketCap.start,\n tokenSupply,\n config.tokenDecimals,\n );\n const endValidation = validateMarketCapParameters(\n config.marketCap.end,\n tokenSupply,\n config.tokenDecimals,\n );\n\n // Log warnings if any\n const allWarnings = [\n ...startValidation.warnings,\n ...endValidation.warnings,\n ];\n if (allWarnings.length > 0) {\n console.warn('Market cap validation warnings:');\n allWarnings.forEach((w) => console.warn(` - ${w}`));\n }\n\n // Convert market cap range to ticks for V3 Static auction\n const { startTick, endTick } = marketCapToTicksForStaticAuction({\n marketCapRange: config.marketCap,\n tokenSupply,\n numerairePriceUSD: config.numerairePrice,\n tickSpacing,\n tokenDecimals: config.tokenDecimals ?? 18,\n numeraireDecimals: config.numeraireDecimals ?? 18,\n });\n\n // Set pool config\n this.pool = {\n startTick,\n endTick,\n fee,\n numPositions: config.numPositions ?? DEFAULT_V3_NUM_POSITIONS,\n maxShareToBeSold:\n config.maxShareToBeSold ?? DEFAULT_V3_MAX_SHARE_TO_BE_SOLD,\n };\n }\n\n if (!this.pool) throw new Error('pool configuration is required');\n\n // Default governance: noOp on supported chains, default on others (e.g., Ink)\n const governance =\n this.governance ??\n (isNoOpEnabledChain(this.chainId)\n ? { type: 'noOp' as const }\n : { type: 'default' as const });\n\n if (\n governance.type === 'launchpad' &&\n !isLaunchpadEnabledChain(this.chainId)\n ) {\n throw new Error(\n `Launchpad governance is not supported on chain ${this.chainId}. Use a supported chain or a different governance type.`,\n );\n }\n\n // Merge beneficiaries into pool config if provided\n const poolWithBeneficiaries = this.beneficiaries\n ? { ...this.pool, beneficiaries: this.beneficiaries }\n : this.pool;\n\n // Validate noOp migration requires beneficiaries\n // NoOpMigrator is designed for locked pools with beneficiaries. Without beneficiaries,\n // the pool status is \"Initialized\" (not \"Locked\"), meaning exitLiquidity() can be called.\n // But NoOpMigrator.migrate() always reverts, so the entire graduation transaction fails\n // and liquidity becomes trapped.\n if (this.migration.type === 'noOp') {\n const hasBeneficiaries =\n poolWithBeneficiaries.beneficiaries &&\n poolWithBeneficiaries.beneficiaries.length > 0;\n if (!hasBeneficiaries) {\n throw new Error(\n 'noOp migration requires beneficiaries. Without beneficiaries, the pool would be stuck after reaching ' +\n 'graduation - exitLiquidity() succeeds but NoOpMigrator.migrate() always reverts, causing the entire ' +\n 'transaction to fail. Either add beneficiaries via withBeneficiaries() or use a different migration type (uniswapV2, uniswapV4).',\n );\n }\n }\n\n return {\n token: this.token,\n sale: this.sale,\n pool: poolWithBeneficiaries,\n vesting: this.vesting,\n governance: governance as GovernanceOption<C>,\n migration: this.migration,\n integrator: this.integrator ?? ZERO_ADDRESS,\n userAddress: this.userAddress,\n modules: this.moduleAddresses,\n gas: this.gasLimit,\n };\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/builders/StaticAuctionBuilder.ts"],"names":["DEFAULT_V3_YEARLY_MINT_RATE","DEFAULT_V3_FEE","V3_FEE_TIERS","DEFAULT_V3_START_TICK","DEFAULT_V3_END_TICK","DEFAULT_V3_NUM_POSITIONS","DEFAULT_V3_MAX_SHARE_TO_BE_SOLD","TICK_SPACINGS","computeTicks","DEFAULT_V3_VESTING_DURATION","ZERO_ADDRESS","validateMarketCapParameters","marketCapToTicksForStaticAuction","isNoOpEnabledChain","isLaunchpadEnabledChain"],"mappings":";;;;;;;;AAgCO,IAAM,oBAAA,GAAN,MAAM,qBAAA,CAEsB;AAAA,EAyBjC,YAAY,OAAA,EAAY;AACtB,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AAAA,EACjB;AAAA,EAEA,OAAO,SACL,OAAA,EACyB;AACzB,IAAA,OAAO,IAAI,sBAAqB,OAAO,CAAA;AAAA,EACzC;AAAA,EAEA,YACE,MAAA,EAeM;AACN,IAAA,IAAI,MAAA,IAAU,MAAA,IAAU,MAAA,IAAU,MAAA,CAAO,SAAS,YAAA,EAAc;AAC9D,MAAA,IAAA,CAAK,KAAA,GAAQ;AAAA,QACX,IAAA,EAAM,YAAA;AAAA,QACN,MAAM,MAAA,CAAO,IAAA;AAAA,QACb,QAAQ,MAAA,CAAO,MAAA;AAAA,QACf,SAAS,MAAA,CAAO,OAAA;AAAA,QAChB,MAAM,MAAA,CAAO;AAAA,OACf;AAAA,IACF,CAAA,MAAO;AACL,MAAA,IAAA,CAAK,KAAA,GAAQ;AAAA,QACX,IAAA,EAAM,UAAA;AAAA,QACN,MAAM,MAAA,CAAO,IAAA;AAAA,QACb,QAAQ,MAAA,CAAO,MAAA;AAAA,QACf,UAAU,MAAA,CAAO,QAAA;AAAA,QACjB,cAAA,EAAgB,OAA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OAAA;AAAA,MACd,UAAA;AAAA,MACA,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,UAAA,EAAY,KAAK,UAAA,IAAcJ,6BAAA;AAAA,MAC/B,aAAa,IAAA,CAAK,WAAA;AAAA,MAClB,SAAS,IAAA,CAAK,eAAA;AAAA,MACd,KAAK,IAAA,CAAK;AAAA,KACZ;AAAA,EACF;AACF","file":"chunk-TJCMFITE.js","sourcesContent":["import type { Address } from 'viem';\nimport {\n DEFAULT_V3_END_TICK,\n DEFAULT_V3_FEE,\n DEFAULT_V3_MAX_SHARE_TO_BE_SOLD,\n DEFAULT_V3_NUM_POSITIONS,\n DEFAULT_V3_START_TICK,\n DEFAULT_V3_VESTING_DURATION,\n DEFAULT_V3_YEARLY_MINT_RATE,\n TICK_SPACINGS,\n V3_FEE_TIERS,\n ZERO_ADDRESS,\n} from '../constants';\nimport {\n marketCapToTicksForStaticAuction,\n validateMarketCapParameters,\n} from '../utils';\nimport {\n isNoOpEnabledChain,\n isLaunchpadEnabledChain,\n type CreateStaticAuctionParams,\n type GovernanceOption,\n type MigrationConfig,\n type PriceRange,\n type VestingConfig,\n type TokenConfig,\n type StaticAuctionMarketCapConfig,\n type ModuleAddressOverrides,\n} from '../types';\nimport { type SupportedChainId } from '../addresses';\nimport { computeTicks, type BaseAuctionBuilder } from './shared';\n\nexport class StaticAuctionBuilder<\n C extends SupportedChainId,\n> implements BaseAuctionBuilder<C> {\n private token?: TokenConfig;\n private sale?: CreateStaticAuctionParams<C>['sale'];\n private pool?: CreateStaticAuctionParams<C>['pool'];\n private beneficiaries?: { beneficiary: Address; shares: bigint }[];\n private vesting?: VestingConfig;\n private governance?: GovernanceOption<C>;\n private migration?: MigrationConfig;\n private integrator?: Address;\n private userAddress?: Address;\n private moduleAddresses?: ModuleAddressOverrides;\n private gasLimit?: bigint;\n // Deferred market cap config - converted to pool in build()\n private marketCapConfig?: {\n marketCap: { start: number; end: number };\n numerairePrice: number;\n tokenSupply?: bigint;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n fee?: number;\n numPositions?: number;\n maxShareToBeSold?: bigint;\n };\n public chainId: C;\n\n constructor(chainId: C) {\n this.chainId = chainId;\n }\n\n static forChain<C extends SupportedChainId>(\n chainId: C,\n ): StaticAuctionBuilder<C> {\n return new StaticAuctionBuilder(chainId);\n }\n\n tokenConfig(\n params:\n | {\n type?: 'standard';\n name: string;\n symbol: string;\n tokenURI: string;\n yearlyMintRate?: bigint;\n }\n | {\n type: 'doppler404';\n name: string;\n symbol: string;\n baseURI: string;\n unit?: bigint;\n },\n ): this {\n if (params && 'type' in params && params.type === 'doppler404') {\n this.token = {\n type: 'doppler404',\n name: params.name,\n symbol: params.symbol,\n baseURI: params.baseURI,\n unit: params.unit,\n };\n } else {\n this.token = {\n type: 'standard',\n name: params.name,\n symbol: params.symbol,\n tokenURI: params.tokenURI,\n yearlyMintRate: params.yearlyMintRate ?? DEFAULT_V3_YEARLY_MINT_RATE,\n };\n }\n return this;\n }\n\n saleConfig(params: {\n initialSupply: bigint;\n numTokensToSell: bigint;\n numeraire: Address;\n }): this {\n this.sale = {\n initialSupply: params.initialSupply,\n numTokensToSell: params.numTokensToSell,\n numeraire: params.numeraire,\n };\n return this;\n }\n\n /**\n * Provide pool ticks directly.\n *\n * Note: Static Auctions use Uniswap V3, which only supports 4 fee tiers:\n * 100 (0.01%), 500 (0.05%), 3000 (0.3%), 10000 (1%).\n * For custom fees, use Dynamic or Multicurve auctions (V4).\n */\n poolByTicks(params: {\n startTick?: number;\n endTick?: number;\n fee?: number;\n numPositions?: number;\n maxShareToBeSold?: bigint;\n }): this {\n // Mutual exclusion: cannot use poolByTicks() after withMarketCapRange()\n if (this.marketCapConfig) {\n throw new Error(\n 'Cannot use poolByTicks() after withMarketCapRange(). ' +\n 'Use withMarketCapRange() for market cap-based configuration, ' +\n 'or poolByTicks()/poolByPriceRange() for manual tick configuration.',\n );\n }\n\n const fee = params.fee ?? DEFAULT_V3_FEE;\n\n // Validate fee is a V3-supported tier\n if (!(V3_FEE_TIERS as readonly number[]).includes(fee)) {\n throw new Error(\n `Static auctions (Uniswap V3) require standard fee tiers: ${V3_FEE_TIERS.join(', ')}. ` +\n `Got: ${fee}. For custom fees, use Dynamic or Multicurve auctions (Uniswap V4).`,\n );\n }\n\n const startTick = params.startTick ?? DEFAULT_V3_START_TICK;\n const endTick = params.endTick ?? DEFAULT_V3_END_TICK;\n this.pool = {\n startTick,\n endTick,\n fee,\n numPositions: params.numPositions ?? DEFAULT_V3_NUM_POSITIONS,\n maxShareToBeSold:\n params.maxShareToBeSold ?? DEFAULT_V3_MAX_SHARE_TO_BE_SOLD,\n };\n return this;\n }\n\n /**\n * @deprecated Use withMarketCapRange() instead for more intuitive market cap configuration\n */\n poolByPriceRange(params: {\n priceRange: PriceRange;\n fee?: number;\n numPositions?: number;\n maxShareToBeSold?: bigint;\n }): this {\n // Mutual exclusion: cannot use poolByPriceRange() after withMarketCapRange()\n if (this.marketCapConfig) {\n throw new Error(\n 'Cannot use poolByPriceRange() after withMarketCapRange(). ' +\n 'Use withMarketCapRange() for market cap-based configuration, ' +\n 'or poolByTicks()/poolByPriceRange() for manual tick configuration.',\n );\n }\n\n const fee = params.fee ?? DEFAULT_V3_FEE;\n const tickSpacing =\n fee === 100\n ? TICK_SPACINGS[100]\n : fee === 500\n ? TICK_SPACINGS[500]\n : fee === 3000\n ? TICK_SPACINGS[3000]\n : TICK_SPACINGS[10000];\n const ticks = computeTicks(params.priceRange, tickSpacing);\n return this.poolByTicks({\n startTick: ticks.startTick,\n endTick: ticks.endTick,\n fee,\n numPositions: params.numPositions,\n maxShareToBeSold: params.maxShareToBeSold,\n });\n }\n\n /**\n * Configure pool using target market cap range.\n * Converts market cap values (in USD) to Uniswap ticks.\n *\n * @param params - Market cap configuration\n * @returns Builder instance for chaining\n *\n * @example\n * ```ts\n * builder\n * .saleConfig({ initialSupply, numTokensToSell, numeraire: WETH })\n * .withMarketCapRange({\n * marketCap: { start: 100_000, end: 10_000_000 }, // $100k to $10M\n * numerairePrice: 3000, // ETH = $3000\n * })\n * ```\n */\n withMarketCapRange(params: StaticAuctionMarketCapConfig): this {\n // Mutual exclusion: cannot use withMarketCapRange() after poolByTicks()/poolByPriceRange()\n if (this.pool) {\n throw new Error(\n 'Cannot use withMarketCapRange() after poolByTicks()/poolByPriceRange(). ' +\n 'Use withMarketCapRange() for market cap-based configuration, ' +\n 'or poolByTicks()/poolByPriceRange() for manual tick configuration.',\n );\n }\n\n // Basic validation that doesn't require saleConfig\n if (params.numerairePrice <= 0) {\n throw new Error('numerairePrice must be greater than 0');\n }\n if (params.marketCap.start <= 0 || params.marketCap.end <= 0) {\n throw new Error('marketCap values must be greater than 0');\n }\n if (params.marketCap.start >= params.marketCap.end) {\n throw new Error('marketCap.start must be less than marketCap.end');\n }\n\n // Validate fee is a V3-supported tier (if provided)\n if (params.fee !== undefined) {\n if (!(V3_FEE_TIERS as readonly number[]).includes(params.fee)) {\n throw new Error(\n `Static auctions (Uniswap V3) require standard fee tiers: ${V3_FEE_TIERS.join(', ')}. ` +\n `Got: ${params.fee}. For custom fees, use Dynamic or Multicurve auctions (Uniswap V4).`,\n );\n }\n }\n\n // Store config for deferred conversion in build()\n this.marketCapConfig = {\n marketCap: params.marketCap,\n numerairePrice: params.numerairePrice,\n tokenSupply: params.tokenSupply,\n tokenDecimals: params.tokenDecimals,\n numeraireDecimals: params.numeraireDecimals,\n fee: params.fee,\n numPositions: params.numPositions,\n maxShareToBeSold: params.maxShareToBeSold,\n };\n\n return this;\n }\n\n /**\n * Configure beneficiaries for fee streaming on locked V3 pools.\n *\n * When beneficiaries are provided, the pool enters a \"Locked\" state where:\n * - Fees are collected and distributed to beneficiaries according to their shares\n * - Liquidity cannot be exited/migrated (pool stays locked permanently)\n * - Anyone can call collectFees() to distribute accumulated fees\n *\n * IMPORTANT:\n * - Shares must sum to exactly WAD (1e18 = 100%)\n * - Protocol owner (Airlock.owner()) must be included with at least 5% shares\n * - Beneficiaries will be automatically sorted by address (ascending)\n * - Use withMigration({ type: 'noOp' }) when using beneficiaries\n *\n * @example\n * ```typescript\n * builder.withBeneficiaries([\n * { beneficiary: protocolOwner, shares: parseEther('0.05') }, // 5% (minimum required)\n * { beneficiary: teamWallet, shares: parseEther('0.45') }, // 45%\n * { beneficiary: daoTreasury, shares: parseEther('0.50') }, // 50%\n * ])\n * ```\n */\n withBeneficiaries(\n beneficiaries: { beneficiary: Address; shares: bigint }[],\n ): this {\n // Sort beneficiaries by address (ascending) as required by the contract\n this.beneficiaries = [...beneficiaries].sort((a, b) => {\n const aAddr = a.beneficiary.toLowerCase();\n const bAddr = b.beneficiary.toLowerCase();\n return aAddr < bAddr ? -1 : aAddr > bAddr ? 1 : 0;\n });\n return this;\n }\n\n withVesting(params?: {\n duration?: bigint;\n cliffDuration?: number;\n recipients?: Address[];\n amounts?: bigint[];\n }): this {\n if (!params) {\n this.vesting = undefined;\n return this;\n }\n this.vesting = {\n duration: Number(params.duration ?? DEFAULT_V3_VESTING_DURATION),\n cliffDuration: params.cliffDuration ?? 0,\n recipients: params.recipients,\n amounts: params.amounts,\n };\n return this;\n }\n\n withGovernance(params: GovernanceOption<C>): this {\n this.governance = params;\n return this;\n }\n\n withMigration(migration: MigrationConfig): this {\n this.migration = migration;\n return this;\n }\n\n withUserAddress(address: Address): this {\n this.userAddress = address;\n return this;\n }\n\n withIntegrator(address?: Address): this {\n this.integrator = address ?? ZERO_ADDRESS;\n return this;\n }\n\n withGasLimit(gas?: bigint): this {\n this.gasLimit = gas;\n return this;\n }\n\n // Address override helpers\n private overrideModule<K extends keyof ModuleAddressOverrides>(\n key: K,\n address: NonNullable<ModuleAddressOverrides[K]>,\n ): this {\n this.moduleAddresses = {\n ...this.moduleAddresses,\n [key]: address,\n } as ModuleAddressOverrides;\n return this;\n }\n\n withTokenFactory(address: Address): this {\n return this.overrideModule('tokenFactory', address);\n }\n\n withAirlock(address: Address): this {\n return this.overrideModule('airlock', address);\n }\n\n withV3Initializer(address: Address): this {\n return this.overrideModule('v3Initializer', address);\n }\n\n withGovernanceFactory(address: Address): this {\n return this.overrideModule('governanceFactory', address);\n }\n\n withV2Migrator(address: Address): this {\n return this.overrideModule('v2Migrator', address);\n }\n\n withV4Migrator(address: Address): this {\n return this.overrideModule('v4Migrator', address);\n }\n\n withNoOpMigrator(address: Address): this {\n return this.overrideModule('noOpMigrator', address);\n }\n\n build(): CreateStaticAuctionParams<C> {\n if (!this.token) throw new Error('tokenConfig is required');\n if (!this.sale) throw new Error('saleConfig is required');\n if (!this.migration) throw new Error('migration configuration is required');\n if (!this.userAddress) throw new Error('userAddress is required');\n\n // Convert deferred market cap config to pool if set\n if (this.marketCapConfig && !this.pool) {\n const config = this.marketCapConfig;\n\n // Get token supply from config or saleConfig\n const tokenSupply = config.tokenSupply ?? this.sale.initialSupply;\n if (!tokenSupply) {\n throw new Error(\n 'tokenSupply must be provided (either via saleConfig() or withMarketCapRange() params)',\n );\n }\n\n // Determine fee and tick spacing\n const fee = config.fee ?? DEFAULT_V3_FEE;\n const tickSpacing =\n fee === 100\n ? TICK_SPACINGS[100]\n : fee === 500\n ? TICK_SPACINGS[500]\n : fee === 3000\n ? TICK_SPACINGS[3000]\n : TICK_SPACINGS[10000];\n\n // Validate market cap parameters\n const startValidation = validateMarketCapParameters(\n config.marketCap.start,\n tokenSupply,\n config.tokenDecimals,\n );\n const endValidation = validateMarketCapParameters(\n config.marketCap.end,\n tokenSupply,\n config.tokenDecimals,\n );\n\n // Log warnings if any\n const allWarnings = [\n ...startValidation.warnings,\n ...endValidation.warnings,\n ];\n if (allWarnings.length > 0) {\n console.warn('Market cap validation warnings:');\n allWarnings.forEach((w) => console.warn(` - ${w}`));\n }\n\n // Convert market cap range to ticks for V3 Static auction\n const { startTick, endTick } = marketCapToTicksForStaticAuction({\n marketCapRange: config.marketCap,\n tokenSupply,\n numerairePriceUSD: config.numerairePrice,\n tickSpacing,\n tokenDecimals: config.tokenDecimals ?? 18,\n numeraireDecimals: config.numeraireDecimals ?? 18,\n });\n\n // Set pool config\n this.pool = {\n startTick,\n endTick,\n fee,\n numPositions: config.numPositions ?? DEFAULT_V3_NUM_POSITIONS,\n maxShareToBeSold:\n config.maxShareToBeSold ?? DEFAULT_V3_MAX_SHARE_TO_BE_SOLD,\n };\n }\n\n if (!this.pool) throw new Error('pool configuration is required');\n\n // Default governance: noOp on supported chains, default on others (e.g., Ink)\n const governance =\n this.governance ??\n (isNoOpEnabledChain(this.chainId)\n ? { type: 'noOp' as const }\n : { type: 'default' as const });\n\n if (\n governance.type === 'launchpad' &&\n !isLaunchpadEnabledChain(this.chainId)\n ) {\n throw new Error(\n `Launchpad governance is not supported on chain ${this.chainId}. Use a supported chain or a different governance type.`,\n );\n }\n\n // Merge beneficiaries into pool config if provided\n const poolWithBeneficiaries = this.beneficiaries\n ? { ...this.pool, beneficiaries: this.beneficiaries }\n : this.pool;\n\n // Validate noOp migration requires beneficiaries\n // NoOpMigrator is designed for locked pools with beneficiaries. Without beneficiaries,\n // the pool status is \"Initialized\" (not \"Locked\"), meaning exitLiquidity() can be called.\n // But NoOpMigrator.migrate() always reverts, so the entire graduation transaction fails\n // and liquidity becomes trapped.\n if (this.migration.type === 'noOp') {\n const hasBeneficiaries =\n poolWithBeneficiaries.beneficiaries &&\n poolWithBeneficiaries.beneficiaries.length > 0;\n if (!hasBeneficiaries) {\n throw new Error(\n 'noOp migration requires beneficiaries. Without beneficiaries, the pool would be stuck after reaching ' +\n 'graduation - exitLiquidity() succeeds but NoOpMigrator.migrate() always reverts, causing the entire ' +\n 'transaction to fail. Either add beneficiaries via withBeneficiaries() or use a different migration type (uniswapV2, uniswapV4).',\n );\n }\n }\n\n return {\n token: this.token,\n sale: this.sale,\n pool: poolWithBeneficiaries,\n vesting: this.vesting,\n governance: governance as GovernanceOption<C>,\n migration: this.migration,\n integrator: this.integrator ?? ZERO_ADDRESS,\n userAddress: this.userAddress,\n modules: this.moduleAddresses,\n gas: this.gasLimit,\n };\n }\n}\n"]}
@@ -1,22 +1,22 @@
1
1
  'use strict';
2
2
 
3
- var chunkZ7ZGPSQF_js = require('./chunk-Z7ZGPSQF.js');
3
+ var chunkP4BT5GDO_js = require('./chunk-P4BT5GDO.js');
4
4
 
5
5
  // src/types.ts
6
6
  var NO_OP_ENABLED_CHAIN_IDS = [
7
- chunkZ7ZGPSQF_js.CHAIN_IDS.BASE,
8
- chunkZ7ZGPSQF_js.CHAIN_IDS.BASE_SEPOLIA,
9
- chunkZ7ZGPSQF_js.CHAIN_IDS.UNICHAIN,
10
- chunkZ7ZGPSQF_js.CHAIN_IDS.UNICHAIN_SEPOLIA,
11
- chunkZ7ZGPSQF_js.CHAIN_IDS.MONAD_TESTNET,
12
- chunkZ7ZGPSQF_js.CHAIN_IDS.MONAD_MAINNET
7
+ chunkP4BT5GDO_js.CHAIN_IDS.BASE,
8
+ chunkP4BT5GDO_js.CHAIN_IDS.BASE_SEPOLIA,
9
+ chunkP4BT5GDO_js.CHAIN_IDS.UNICHAIN,
10
+ chunkP4BT5GDO_js.CHAIN_IDS.UNICHAIN_SEPOLIA,
11
+ chunkP4BT5GDO_js.CHAIN_IDS.MONAD_TESTNET,
12
+ chunkP4BT5GDO_js.CHAIN_IDS.MONAD_MAINNET
13
13
  ];
14
14
  function isNoOpEnabledChain(chainId) {
15
15
  return NO_OP_ENABLED_CHAIN_IDS.includes(chainId);
16
16
  }
17
17
  var LAUNCHPAD_ENABLED_CHAIN_IDS = [
18
- chunkZ7ZGPSQF_js.CHAIN_IDS.BASE,
19
- chunkZ7ZGPSQF_js.CHAIN_IDS.MONAD_MAINNET
18
+ chunkP4BT5GDO_js.CHAIN_IDS.BASE,
19
+ chunkP4BT5GDO_js.CHAIN_IDS.MONAD_MAINNET
20
20
  ];
21
21
  function isLaunchpadEnabledChain(chainId) {
22
22
  return LAUNCHPAD_ENABLED_CHAIN_IDS.includes(chainId);
@@ -34,5 +34,5 @@ exports.LockablePoolStatus = LockablePoolStatus;
34
34
  exports.NO_OP_ENABLED_CHAIN_IDS = NO_OP_ENABLED_CHAIN_IDS;
35
35
  exports.isLaunchpadEnabledChain = isLaunchpadEnabledChain;
36
36
  exports.isNoOpEnabledChain = isNoOpEnabledChain;
37
- //# sourceMappingURL=chunk-TL7U67CX.js.map
38
- //# sourceMappingURL=chunk-TL7U67CX.js.map
37
+ //# sourceMappingURL=chunk-UIPSHVT4.js.map
38
+ //# sourceMappingURL=chunk-UIPSHVT4.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts"],"names":["CHAIN_IDS","LockablePoolStatus"],"mappings":";;;;;AA0EO,IAAM,uBAAA,GAA0B;AAAA,EACrCA,0BAAA,CAAU,IAAA;AAAA,EACVA,0BAAA,CAAU,YAAA;AAAA,EACVA,0BAAA,CAAU,QAAA;AAAA,EACVA,0BAAA,CAAU,gBAAA;AAAA,EACVA,0BAAA,CAAU,aAAA;AAAA,EACVA,0BAAA,CAAU;AACZ;AAOO,SAAS,mBACd,OAAA,EAC+B;AAC/B,EAAA,OAAQ,uBAAA,CAA8C,SAAS,OAAO,CAAA;AACxE;AAGO,IAAM,2BAAA,GAA8B;AAAA,EACzCA,0BAAA,CAAU,IAAA;AAAA,EACVA,0BAAA,CAAU;AACZ;AAQO,SAAS,wBACd,OAAA,EACoC;AACpC,EAAA,OAAQ,2BAAA,CAAkD,SAAS,OAAO,CAAA;AAC5E;AA8BO,IAAK,kBAAA,qBAAAC,mBAAAA,KAAL;AACL,EAAAA,mBAAAA,CAAAA,mBAAAA,CAAA,mBAAgB,CAAA,CAAA,GAAhB,eAAA;AACA,EAAAA,mBAAAA,CAAAA,mBAAAA,CAAA,iBAAc,CAAA,CAAA,GAAd,aAAA;AACA,EAAAA,mBAAAA,CAAAA,mBAAAA,CAAA,YAAS,CAAA,CAAA,GAAT,QAAA;AACA,EAAAA,mBAAAA,CAAAA,mBAAAA,CAAA,YAAS,CAAA,CAAA,GAAT,QAAA;AAJU,EAAA,OAAAA,mBAAAA;AAAA,CAAA,EAAA,kBAAA,IAAA,EAAA","file":"chunk-TL7U67CX.js","sourcesContent":["import { base, baseSepolia, ink, unichain } from 'viem/chains';\nimport { CHAIN_IDS, type SupportedChainId } from './addresses';\n// Re-export SupportedChainId so consumers can import from this module\nexport { type SupportedChainId } from './addresses';\nimport type { Address, WalletClient } from 'viem';\n\nexport type SupportedChain =\n | typeof base\n | typeof baseSepolia\n | typeof ink\n | typeof unichain\n | typeof baseSepolia;\n// Use a wide type to avoid cross-package viem type identity issues when linking packages locally.\nexport type SupportedPublicClient = unknown;\n\n// Core configuration types\n// Token configuration (discriminated union)\nexport interface StandardTokenConfig {\n type?: 'standard'; // default behavior (backwards compatible)\n name: string;\n symbol: string;\n tokenURI: string;\n yearlyMintRate?: bigint; // Optional yearly mint rate (in WAD, default: 2% = 0.02e18)\n}\n\nexport interface Doppler404TokenConfig {\n type: 'doppler404';\n name: string;\n symbol: string;\n baseURI: string;\n // Optional unit for DN404 factory (uint256). Defaults to 1000 when omitted.\n unit?: bigint;\n}\n\nexport type TokenConfig = StandardTokenConfig | Doppler404TokenConfig;\n\nexport interface SaleConfig {\n initialSupply: bigint;\n numTokensToSell: bigint;\n numeraire: Address; // e.g., WETH address\n}\n\n// Static Auction Pool configuration\nexport interface StaticPoolConfig {\n startTick: number;\n endTick: number;\n fee: number; // e.g., 3000 for 0.3%\n // Optional parameters for lockable initializer\n numPositions?: number; // Number of liquidity positions (default: based on tick range)\n maxShareToBeSold?: bigint; // Maximum share of tokens to sell (in WAD, default: 1e18 = 100%)\n beneficiaries?: BeneficiaryData[]; // Optional beneficiaries for fee streaming\n}\n\n// Dynamic Auction configuration\nexport interface DynamicAuctionConfig {\n duration: number; // in seconds\n epochLength: number; // in seconds\n startTick: number;\n endTick: number;\n gamma?: number; // Optional, can be auto-calculated\n minProceeds: bigint;\n maxProceeds: bigint;\n numPdSlugs?: number; // Price discovery slugs (optional)\n}\n\n// Vesting configuration\nexport interface VestingConfig {\n duration: number; // in seconds\n cliffDuration: number; // in seconds\n recipients?: Address[]; // Optional array of recipient addresses (defaults to [userAddress] if not specified)\n amounts?: bigint[]; // Optional array of vesting amounts per recipient (must match recipients length if provided)\n}\n\n// Chains where no-op governance is enabled\nexport const NO_OP_ENABLED_CHAIN_IDS = [\n CHAIN_IDS.BASE,\n CHAIN_IDS.BASE_SEPOLIA,\n CHAIN_IDS.UNICHAIN,\n CHAIN_IDS.UNICHAIN_SEPOLIA,\n CHAIN_IDS.MONAD_TESTNET,\n CHAIN_IDS.MONAD_MAINNET,\n] as const;\n\nexport type NoOpEnabledChainId = (typeof NO_OP_ENABLED_CHAIN_IDS)[number];\n\n/**\n * Check if a chain supports no-op governance\n */\nexport function isNoOpEnabledChain(\n chainId: number,\n): chainId is NoOpEnabledChainId {\n return (NO_OP_ENABLED_CHAIN_IDS as readonly number[]).includes(chainId);\n}\n\n// Chains where launchpad governance is enabled\nexport const LAUNCHPAD_ENABLED_CHAIN_IDS = [\n CHAIN_IDS.BASE,\n CHAIN_IDS.MONAD_MAINNET,\n] as const;\n\nexport type LaunchpadEnabledChainId =\n (typeof LAUNCHPAD_ENABLED_CHAIN_IDS)[number];\n\n/**\n * Check if a chain supports launchpad governance\n */\nexport function isLaunchpadEnabledChain(\n chainId: number,\n): chainId is LaunchpadEnabledChainId {\n return (LAUNCHPAD_ENABLED_CHAIN_IDS as readonly number[]).includes(chainId);\n}\n\n// Governance configuration (discriminated union)\nexport type GovernanceDefault = { type: 'default' };\nexport interface GovernanceCustom {\n type: 'custom';\n initialVotingDelay: number;\n initialVotingPeriod: number;\n initialProposalThreshold: bigint;\n}\nexport type GovernanceNoOp = { type: 'noOp' };\nexport interface GovernanceLaunchpad {\n type: 'launchpad';\n multisig: Address;\n}\n\nexport type GovernanceOption<C extends SupportedChainId> =\n | GovernanceDefault\n | GovernanceCustom\n | (C extends NoOpEnabledChainId ? GovernanceNoOp : never)\n | (C extends LaunchpadEnabledChainId ? GovernanceLaunchpad : never);\n\n// Unified beneficiary data used for fee streaming, lockable initializers, and migration configs\n// Uses shares in WAD format (1e18 = 100%) for consistency across all beneficiary configurations\nexport interface BeneficiaryData {\n beneficiary: Address;\n shares: bigint; // shares in WAD (1e18 = 100%)\n}\n\n// Pool status for lockable initializer\nexport enum LockablePoolStatus {\n Uninitialized = 0,\n Initialized = 1,\n Locked = 2,\n Exited = 3,\n}\n\n// Lockable pool state\nexport interface LockablePoolState {\n asset: Address;\n numeraire: Address;\n tickLower: number;\n tickUpper: number;\n maxShareToBeSold: bigint;\n totalTokensOnBondingCurve: bigint;\n status: LockablePoolStatus;\n}\n\n// Multicurve pool state (V4 initializer)\nexport interface MulticurvePoolState {\n asset: Address;\n numeraire: Address;\n fee: number;\n tickSpacing: number;\n status: LockablePoolStatus; // Reuses the same enum\n poolKey: V4PoolKey;\n farTick: number;\n}\n\n// Migration configuration (discriminated union)\nexport type MigrationConfig =\n | { type: 'uniswapV2' } // Basic migration to a new Uniswap v2 pool\n | {\n type: 'uniswapV4';\n fee: number;\n tickSpacing: number;\n // Configuration for fee streaming via StreamableFeesLocker (optional)\n // When omitted, fees are not locked and beneficiaries are not configured\n // This is useful when using noOp governance where lock duration is not meaningful\n streamableFees?: {\n lockDuration: number; // in seconds\n beneficiaries: BeneficiaryData[]; // Uses shares in WAD (1e18 = 100%)\n };\n }\n | { type: 'noOp' }; // No migration - used with lockable beneficiaries\n\n// Create Static Auction parameters\nexport interface CreateStaticAuctionParams<\n C extends SupportedChainId = SupportedChainId,\n> {\n // Token configuration\n token: TokenConfig;\n\n // Sale configuration\n sale: SaleConfig;\n\n // Static Auction (Uniswap v3) Pool configuration\n pool: StaticPoolConfig;\n\n // Vesting configuration (optional)\n vesting?: VestingConfig;\n\n // Governance configuration (required). Use `{ type: 'noOp' }` where enabled,\n // `{ type: 'default' }` for standard defaults, or `{ type: 'custom', ... }` to customize.\n governance: GovernanceOption<C>;\n\n // Explicit Migration Configuration\n migration: MigrationConfig;\n\n // Integrator details\n integrator?: Address;\n userAddress: Address;\n\n // Optional address overrides for on-chain modules used during encoding/creation\n modules?: ModuleAddressOverrides;\n\n // Optional transaction gas limit override for the create() transaction\n // If omitted, SDK will default to 13,500,000 gas for create()\n gas?: bigint;\n}\n\n// Create Dynamic Auction parameters\nexport interface CreateDynamicAuctionParams<\n C extends SupportedChainId = SupportedChainId,\n> {\n // Token configuration\n token: TokenConfig;\n\n // Sale configuration\n sale: SaleConfig;\n\n // Dynamic Auction (Uniswap v4 Hook) configuration\n auction: DynamicAuctionConfig;\n\n // Pool configuration\n pool: {\n fee: number; // e.g., 3000 for 0.3%\n tickSpacing: number;\n };\n\n // Vesting configuration (optional)\n vesting?: VestingConfig;\n\n // Governance configuration (required). Use `{ type: 'noOp' }` where enabled,\n // `{ type: 'default' }` for standard defaults, or `{ type: 'custom', ... }` to customize.\n governance: GovernanceOption<C>;\n\n // Explicit Migration Configuration\n migration: MigrationConfig;\n\n // Integrator details\n integrator?: Address;\n userAddress: Address;\n\n // Time configuration (internal use)\n startTimeOffset?: number;\n blockTimestamp?: number; // Optional: use this block timestamp instead of fetching latest\n\n // Optional transaction gas limit override for the create() transaction\n // If omitted, SDK will default to 13,500,000 gas for create()\n gas?: bigint;\n\n // Optional address overrides for on-chain modules used during encoding/creation\n modules?: ModuleAddressOverrides;\n}\n\n// Price range configuration for automatic tick calculation\nexport interface PriceRange {\n startPrice: number;\n endPrice: number;\n}\n\n// Tick range configuration\nexport interface TickRange {\n startTick: number;\n endTick: number;\n}\n\n// ============================================================================\n// Market Cap Configuration Types\n// ============================================================================\n\n/**\n * Market cap range in USD for price configurations.\n * Used to define start and end market caps for bonding curves.\n */\nexport interface MarketCapRange {\n /** Starting market cap in USD (e.g., 100_000 for $100k) */\n start: number;\n /** Ending market cap in USD (e.g., 10_000_000 for $10M) */\n end: number;\n}\n\n/**\n * Base configuration for market cap-based tick calculations.\n * Used by builder methods to convert market caps to ticks.\n */\nexport interface MarketCapConfig {\n /** Target market cap range in USD */\n marketCap: MarketCapRange;\n /** Price of numeraire in USD (e.g., 3000 for ETH at $3000) */\n numerairePrice: number;\n /**\n * Token supply override. If not provided, inferred from saleConfig.initialSupply.\n * Must include decimals (e.g., parseEther('1000000000') for 1B tokens).\n */\n tokenSupply?: bigint;\n /** Token decimals (default: 18) */\n tokenDecimals?: number;\n /** Numeraire decimals (default: 18) */\n numeraireDecimals?: number;\n}\n\n/**\n * Market cap configuration for V3 Static Auctions.\n * Extends base config with V3-specific parameters.\n */\nexport interface StaticAuctionMarketCapConfig extends MarketCapConfig {\n /** Fee tier in basis points (e.g., 10000 for 1%). Default: 10000 */\n fee?: number;\n /** Number of liquidity positions. Default: 15 */\n numPositions?: number;\n /** Maximum share of tokens to sell per position (WAD). Default: 35% */\n maxShareToBeSold?: bigint;\n}\n\n/**\n * Market cap range for V4 Dynamic Auctions (Dutch auctions).\n * Uses start/min because price descends from start to minimum.\n */\nexport interface DynamicMarketCapRange {\n /** Starting market cap in USD - auction begins here (e.g., 500_000 for $500k) */\n start: number;\n /** Minimum market cap in USD - floor price the auction descends to (e.g., 50_000 for $50k) */\n min: number;\n}\n\n/**\n * Market cap configuration for V4 Dynamic Auctions.\n * Uses start/min (not start/end) because Dutch auctions descend from start to minimum.\n */\nexport interface DynamicAuctionMarketCapConfig {\n /** Target market cap range (start = launch price, min = floor price) */\n marketCap: DynamicMarketCapRange;\n /** Price of numeraire in USD (e.g., 3000 for ETH at $3000) */\n numerairePrice: number;\n /**\n * Token supply override. If not provided, inferred from saleConfig.initialSupply.\n * Must include decimals (e.g., parseEther('1000000000') for 1B tokens).\n */\n tokenSupply?: bigint;\n /** Token decimals (default: 18) */\n tokenDecimals?: number;\n /** Numeraire decimals (default: 18) */\n numeraireDecimals?: number;\n /**\n * Pool fee in basis points. Default: 10000 (1%)\n *\n * V4 pools support any fee from 0 to 100,000 (10%).\n * Standard tiers (100, 500, 3000, 10000) auto-derive tickSpacing.\n * Custom fees require explicit tickSpacing parameter.\n */\n fee?: number;\n /**\n * Tick spacing for the pool. Required for custom fees.\n *\n * Must be <= 30 for Doppler pools (MAX_TICK_SPACING constraint).\n * If not provided with a standard fee tier, defaults to 30.\n */\n tickSpacing?: number;\n /** Minimum proceeds required for successful auction */\n minProceeds: bigint;\n /** Maximum proceeds cap for the auction */\n maxProceeds: bigint;\n /** Auction duration in seconds. Default: 7 days */\n duration?: number;\n /** Epoch length in seconds. Default: 3600 (1 hour) */\n epochLength?: number;\n /** Gamma (tick decay per epoch). Auto-calculated if not provided */\n gamma?: number;\n /** Number of price discovery slugs. Default: 5 */\n numPdSlugs?: number;\n}\n\n/**\n * Result of market cap parameter validation.\n */\nexport interface MarketCapValidationResult {\n /** Whether all parameters are within normal bounds */\n valid: boolean;\n /** Warning messages for unusual but technically valid values */\n warnings: string[];\n}\n\n// ============================================================================\n// Market Cap Helper Function Parameter Types\n// ============================================================================\n\n/**\n * Parameters for converting market cap range to ticks for V3 Static Auctions.\n */\nexport interface StaticAuctionTickParams {\n marketCapRange: MarketCapRange;\n tokenSupply: bigint;\n numerairePriceUSD: number;\n tickSpacing: number;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n}\n\n/**\n * Parameters for converting market cap range to ticks for V4 Dynamic Auctions.\n */\nexport interface DynamicAuctionTickParams {\n marketCapRange: MarketCapRange;\n tokenSupply: bigint;\n numerairePriceUSD: number;\n numeraire: Address;\n tickSpacing: number;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n}\n\n/**\n * Parameters for converting market cap range to ticks for V4 Multicurve pools.\n */\nexport interface MulticurveTickRangeParams {\n marketCapLower: number;\n marketCapUpper: number | 'max';\n tokenSupply: bigint;\n numerairePriceUSD: number;\n tickSpacing: number;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n}\n\n/**\n * Parameters for converting a single market cap to a tick for Multicurve.\n */\nexport interface MulticurveTickParams {\n marketCapUSD: number;\n tokenSupply: bigint;\n numerairePriceUSD: number;\n tickSpacing: number;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n}\n\n/**\n * Parameters for converting a tick to market cap (reverse conversion).\n */\nexport interface TickToMarketCapParams {\n tick: number;\n tokenSupply: bigint;\n numerairePriceUSD: number;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n}\n\n// ============================================================================\n// New Multicurve Market Cap API (no tick math required)\n// ============================================================================\n\n/**\n * Curve configuration for Multicurve pools using market cap ranges.\n * Each curve defines a market cap range and liquidity distribution.\n */\nexport interface MulticurveMarketCapRangeCurve {\n /** Market cap range for this curve */\n marketCap: {\n /** Start market cap in USD (for the first curve, this is the launch price) */\n start: number;\n /** End market cap in USD, or 'max' for MAX_TICK rounded to tick spacing */\n end: number | 'max';\n };\n /** Number of liquidity positions in this curve */\n numPositions: number;\n /** Share of total supply allocated to this curve (WAD, e.g., parseEther('0.3') = 30%) */\n shares: bigint;\n}\n\n/**\n * Market cap-based configuration for Multicurve pools.\n * No tick math required - just specify market caps in USD.\n */\nexport interface MulticurveMarketCapCurvesConfig {\n /** Price of numeraire in USD (e.g., 3000 for ETH at $3000) */\n numerairePrice: number;\n /**\n * Array of curves defining market cap ranges and liquidity distribution.\n * The first curve's marketCap.start is the launch price.\n * Curves must be contiguous (no gaps allowed).\n */\n curves: MulticurveMarketCapRangeCurve[];\n /** Token supply override */\n tokenSupply?: bigint;\n /** Token decimals (default: 18) */\n tokenDecimals?: number;\n /** Numeraire decimals (default: 18) */\n numeraireDecimals?: number;\n /** Fee tier (default: FEE_TIERS.LOW) */\n fee?: number;\n /** Tick spacing (derived from fee if not provided) */\n tickSpacing?: number;\n /** Optional beneficiaries for fee streaming */\n beneficiaries?: BeneficiaryData[];\n}\n\n// Build configuration for static auctions (V3-style)\nexport interface StaticAuctionBuildConfig {\n // Token details\n name: string;\n symbol: string;\n totalSupply?: bigint; // default: 1 billion\n numTokensToSell?: bigint; // default: 900 million\n tokenURI: string;\n\n // Time parameters\n startTimeOffset?: number; // Optional - seconds to add to current block timestamp (default: 30)\n\n // Price parameters - must provide either priceRange or tickRange\n numeraire: Address; // Required for V3\n tickRange?: TickRange;\n priceRange?: PriceRange;\n fee?: number; // default: 10000 (1%)\n\n // Pool parameters (V3 specific)\n numPositions?: number; // default: 15\n maxShareToBeSold?: bigint; // default: 35% in WAD\n\n // Vesting parameters\n yearlyMintRate?: bigint; // default: 2%\n vestingDuration?: bigint; // default: 1 year\n recipients?: Address[]; // defaults to [userAddress]\n amounts?: bigint[]; // defaults based on pre-mint calculation\n\n // Migration configuration\n migration: MigrationConfig;\n\n // Other parameters\n integrator?: Address;\n useGovernance?: boolean; // default: true\n}\n\n// Build configuration for dynamic auctions (V4-style)\nexport interface DynamicAuctionBuildConfig {\n // Token details\n name: string;\n symbol: string;\n totalSupply: bigint;\n numTokensToSell: bigint;\n tokenURI: string;\n\n // Time parameters\n startTimeOffset?: number; // Optional - seconds to add to block timestamp (default: 30)\n blockTimestamp?: number; // Optional - specific block timestamp to use (default: fetch latest)\n duration?: number; // in seconds (default: 604800 = 7 days)\n epochLength?: number; // in seconds (default: 3600)\n\n // Price parameters - must provide either priceRange or tickRange\n numeraire?: Address; // defaults to zero address\n tickRange?: TickRange;\n priceRange?: PriceRange;\n tickSpacing: number;\n gamma?: number; // auto-calculated if not provided\n fee: number; // In basis points\n\n // Sale parameters\n minProceeds: bigint;\n maxProceeds: bigint;\n numPdSlugs?: number; // default: 5\n\n // Vesting parameters\n yearlyMintRate?: bigint; // default: 2%\n vestingDuration: bigint;\n recipients: Address[];\n amounts: bigint[];\n\n // Migration configuration\n migration: MigrationConfig;\n\n // Other parameters\n integrator?: Address;\n useGovernance?: boolean; // default: true\n}\n\n// SDK initialization configuration\nexport interface DopplerSDKConfig {\n publicClient: SupportedPublicClient;\n walletClient?: WalletClient;\n chainId: number;\n}\n\n// Pool information types\nexport interface PoolInfo {\n address: Address;\n tokenAddress: Address;\n numeraireAddress: Address;\n fee: number;\n liquidity: bigint;\n sqrtPriceX96: bigint;\n}\n\nexport interface HookInfo {\n hookAddress: Address;\n tokenAddress: Address;\n numeraireAddress: Address;\n poolId: string;\n currentEpoch: number;\n totalProceeds: bigint;\n totalTokensSold: bigint;\n earlyExit: boolean;\n insufficientProceeds: boolean;\n startingTime: bigint;\n endingTime: bigint;\n epochLength: bigint;\n minimumProceeds: bigint;\n maximumProceeds: bigint;\n}\n\n// Quote result type\nexport interface QuoteResult {\n amountOut: bigint;\n priceImpact: number;\n fee: bigint;\n route: string[];\n}\n\n// Lockable Uniswap V3 Initializer encode params\nexport interface LockableV3InitializerParams {\n fee: number;\n tickLower: number;\n tickUpper: number;\n numPositions: number;\n maxShareToBeSold: bigint;\n beneficiaries: BeneficiaryData[];\n}\n\n// Multicurve curve configuration (mirrors solidity struct)\nexport interface MulticurveCurve {\n tickLower: number; // int24\n tickUpper: number; // int24\n numPositions: number; // uint16\n shares: bigint; // uint256 (WAD)\n}\n\nexport type MulticurveMarketCapPreset = 'low' | 'medium' | 'high';\n\nexport interface V4PoolKey {\n currency0: Address;\n currency1: Address;\n fee: number;\n tickSpacing: number;\n hooks: Address;\n}\n\nexport interface MulticurveBundleExactOutResult {\n asset: Address;\n poolKey: V4PoolKey;\n amountIn: bigint;\n gasEstimate: bigint;\n}\n\nexport interface MulticurveBundleExactInResult {\n asset: Address;\n poolKey: V4PoolKey;\n amountOut: bigint;\n gasEstimate: bigint;\n}\n\n// RehypeDopplerHook configuration for fee distribution and buyback\nexport interface RehypeDopplerHookConfig {\n // The hook contract address (must be whitelisted in the initializer)\n hookAddress: Address;\n // Destination address for buyback tokens\n buybackDestination: Address;\n // Custom swap fee in basis points (e.g., 3000 = 0.3%)\n customFee: number;\n // Fee distribution percentages (must sum to 100% / WAD)\n // Percentage of fees used for asset buyback (in WAD, e.g., 0.2e18 = 20%)\n assetBuybackPercentWad: bigint;\n // Percentage of fees used for numeraire buyback (in WAD, e.g., 0.2e18 = 20%)\n numeraireBuybackPercentWad: bigint;\n // Percentage of fees distributed to beneficiaries (in WAD, e.g., 0.3e18 = 30%)\n beneficiaryPercentWad: bigint;\n // Percentage of fees distributed to LPs (in WAD, e.g., 0.3e18 = 30%)\n lpPercentWad: bigint;\n // Optional graduation calldata (called when pool graduates)\n graduationCalldata?: `0x${string}`;\n\n // Graduation threshold configuration (rehype-only)\n // Market cap in USD at which pool can graduate. Requires numerairePrice (from withCurves() or explicit).\n graduationMarketCap?: number;\n // Price of numeraire in USD. Optional if using withCurves() (reuses that value). Required with poolConfig().\n numerairePrice?: number;\n // Direct tick value for graduation threshold. Use graduationMarketCap for USD-based config.\n farTick?: number;\n}\n\n// Create Multicurve initializer parameters\nexport interface CreateMulticurveParams<\n C extends SupportedChainId = SupportedChainId,\n> {\n // Token configuration\n token: TokenConfig;\n\n // Sale configuration\n sale: SaleConfig;\n\n // Pool configuration for multicurve initializer\n pool: {\n fee: number;\n tickSpacing: number;\n curves: MulticurveCurve[];\n // Optional beneficiaries to lock the pool (fee collection only, no migration)\n beneficiaries?: BeneficiaryData[];\n };\n\n // Optional scheduled launch configuration\n schedule?: {\n startTime: number;\n };\n\n dopplerHook?: RehypeDopplerHookConfig;\n\n // Vesting configuration (optional)\n vesting?: VestingConfig;\n\n // Governance configuration\n governance: GovernanceOption<C>;\n\n // Migration configuration (can be any supported migrator: V2, V3, or V4)\n migration: MigrationConfig;\n\n // Integrator details\n integrator?: Address;\n userAddress: Address;\n\n // Optional address overrides for on-chain modules used during encoding/creation\n modules?: ModuleAddressOverrides;\n\n // Optional transaction gas limit override for the create() transaction\n gas?: bigint;\n}\n\n// Final Params object that gets passed as arg to create\nexport interface CreateParams {\n initialSupply: bigint;\n numTokensToSell: bigint;\n numeraire: Address;\n tokenFactory: Address;\n tokenFactoryData: `0x${string}`;\n governanceFactory: Address;\n governanceFactoryData: `0x${string}`;\n poolInitializer: Address;\n poolInitializerData: `0x${string}`;\n liquidityMigrator: Address;\n liquidityMigratorData: `0x${string}`;\n integrator: Address;\n salt: `0x${string}`;\n}\n\n// Optional per-call module address overrides. When provided, these take precedence\n// over chain defaults resolved via getAddresses(chainId).\nexport interface ModuleAddressOverrides {\n // Core deployment & routing\n airlock?: Address;\n tokenFactory?: Address;\n\n // Initializers\n v3Initializer?: Address;\n lockableV3Initializer?: Address;\n v4Initializer?: Address;\n v4MulticurveInitializer?: Address;\n v4ScheduledMulticurveInitializer?: Address;\n dopplerHookInitializer?: Address;\n\n // DopplerHooks\n rehypeDopplerHook?: Address;\n\n // Governance\n governanceFactory?: Address;\n\n // Dynamic auction infra\n poolManager?: Address;\n dopplerDeployer?: Address;\n\n // Migrators\n v2Migrator?: Address;\n v4Migrator?: Address;\n noOpMigrator?: Address;\n}\n"]}
1
+ {"version":3,"sources":["../src/types.ts"],"names":["CHAIN_IDS","LockablePoolStatus"],"mappings":";;;;;AA0EO,IAAM,uBAAA,GAA0B;AAAA,EACrCA,0BAAA,CAAU,IAAA;AAAA,EACVA,0BAAA,CAAU,YAAA;AAAA,EACVA,0BAAA,CAAU,QAAA;AAAA,EACVA,0BAAA,CAAU,gBAAA;AAAA,EACVA,0BAAA,CAAU,aAAA;AAAA,EACVA,0BAAA,CAAU;AACZ;AAOO,SAAS,mBACd,OAAA,EAC+B;AAC/B,EAAA,OAAQ,uBAAA,CAA8C,SAAS,OAAO,CAAA;AACxE;AAGO,IAAM,2BAAA,GAA8B;AAAA,EACzCA,0BAAA,CAAU,IAAA;AAAA,EACVA,0BAAA,CAAU;AACZ;AAQO,SAAS,wBACd,OAAA,EACoC;AACpC,EAAA,OAAQ,2BAAA,CAAkD,SAAS,OAAO,CAAA;AAC5E;AA8BO,IAAK,kBAAA,qBAAAC,mBAAAA,KAAL;AACL,EAAAA,mBAAAA,CAAAA,mBAAAA,CAAA,mBAAgB,CAAA,CAAA,GAAhB,eAAA;AACA,EAAAA,mBAAAA,CAAAA,mBAAAA,CAAA,iBAAc,CAAA,CAAA,GAAd,aAAA;AACA,EAAAA,mBAAAA,CAAAA,mBAAAA,CAAA,YAAS,CAAA,CAAA,GAAT,QAAA;AACA,EAAAA,mBAAAA,CAAAA,mBAAAA,CAAA,YAAS,CAAA,CAAA,GAAT,QAAA;AAJU,EAAA,OAAAA,mBAAAA;AAAA,CAAA,EAAA,kBAAA,IAAA,EAAA","file":"chunk-UIPSHVT4.js","sourcesContent":["import { base, baseSepolia, ink, unichain } from 'viem/chains';\nimport { CHAIN_IDS, type SupportedChainId } from './addresses';\n// Re-export SupportedChainId so consumers can import from this module\nexport { type SupportedChainId } from './addresses';\nimport type { Address, WalletClient } from 'viem';\n\nexport type SupportedChain =\n | typeof base\n | typeof baseSepolia\n | typeof ink\n | typeof unichain\n | typeof baseSepolia;\n// Use a wide type to avoid cross-package viem type identity issues when linking packages locally.\nexport type SupportedPublicClient = unknown;\n\n// Core configuration types\n// Token configuration (discriminated union)\nexport interface StandardTokenConfig {\n type?: 'standard'; // default behavior (backwards compatible)\n name: string;\n symbol: string;\n tokenURI: string;\n yearlyMintRate?: bigint; // Optional yearly mint rate (in WAD, default: 2% = 0.02e18)\n}\n\nexport interface Doppler404TokenConfig {\n type: 'doppler404';\n name: string;\n symbol: string;\n baseURI: string;\n // Optional unit for DN404 factory (uint256). Defaults to 1000 when omitted.\n unit?: bigint;\n}\n\nexport type TokenConfig = StandardTokenConfig | Doppler404TokenConfig;\n\nexport interface SaleConfig {\n initialSupply: bigint;\n numTokensToSell: bigint;\n numeraire: Address; // e.g., WETH address\n}\n\n// Static Auction Pool configuration\nexport interface StaticPoolConfig {\n startTick: number;\n endTick: number;\n fee: number; // e.g., 3000 for 0.3%\n // Optional parameters for lockable initializer\n numPositions?: number; // Number of liquidity positions (default: based on tick range)\n maxShareToBeSold?: bigint; // Maximum share of tokens to sell (in WAD, default: 1e18 = 100%)\n beneficiaries?: BeneficiaryData[]; // Optional beneficiaries for fee streaming\n}\n\n// Dynamic Auction configuration\nexport interface DynamicAuctionConfig {\n duration: number; // in seconds\n epochLength: number; // in seconds\n startTick: number;\n endTick: number;\n gamma?: number; // Optional, can be auto-calculated\n minProceeds: bigint;\n maxProceeds: bigint;\n numPdSlugs?: number; // Price discovery slugs (optional)\n}\n\n// Vesting configuration\nexport interface VestingConfig {\n duration: number; // in seconds\n cliffDuration: number; // in seconds\n recipients?: Address[]; // Optional array of recipient addresses (defaults to [userAddress] if not specified)\n amounts?: bigint[]; // Optional array of vesting amounts per recipient (must match recipients length if provided)\n}\n\n// Chains where no-op governance is enabled\nexport const NO_OP_ENABLED_CHAIN_IDS = [\n CHAIN_IDS.BASE,\n CHAIN_IDS.BASE_SEPOLIA,\n CHAIN_IDS.UNICHAIN,\n CHAIN_IDS.UNICHAIN_SEPOLIA,\n CHAIN_IDS.MONAD_TESTNET,\n CHAIN_IDS.MONAD_MAINNET,\n] as const;\n\nexport type NoOpEnabledChainId = (typeof NO_OP_ENABLED_CHAIN_IDS)[number];\n\n/**\n * Check if a chain supports no-op governance\n */\nexport function isNoOpEnabledChain(\n chainId: number,\n): chainId is NoOpEnabledChainId {\n return (NO_OP_ENABLED_CHAIN_IDS as readonly number[]).includes(chainId);\n}\n\n// Chains where launchpad governance is enabled\nexport const LAUNCHPAD_ENABLED_CHAIN_IDS = [\n CHAIN_IDS.BASE,\n CHAIN_IDS.MONAD_MAINNET,\n] as const;\n\nexport type LaunchpadEnabledChainId =\n (typeof LAUNCHPAD_ENABLED_CHAIN_IDS)[number];\n\n/**\n * Check if a chain supports launchpad governance\n */\nexport function isLaunchpadEnabledChain(\n chainId: number,\n): chainId is LaunchpadEnabledChainId {\n return (LAUNCHPAD_ENABLED_CHAIN_IDS as readonly number[]).includes(chainId);\n}\n\n// Governance configuration (discriminated union)\nexport type GovernanceDefault = { type: 'default' };\nexport interface GovernanceCustom {\n type: 'custom';\n initialVotingDelay: number;\n initialVotingPeriod: number;\n initialProposalThreshold: bigint;\n}\nexport type GovernanceNoOp = { type: 'noOp' };\nexport interface GovernanceLaunchpad {\n type: 'launchpad';\n multisig: Address;\n}\n\nexport type GovernanceOption<C extends SupportedChainId> =\n | GovernanceDefault\n | GovernanceCustom\n | (C extends NoOpEnabledChainId ? GovernanceNoOp : never)\n | (C extends LaunchpadEnabledChainId ? GovernanceLaunchpad : never);\n\n// Unified beneficiary data used for fee streaming, lockable initializers, and migration configs\n// Uses shares in WAD format (1e18 = 100%) for consistency across all beneficiary configurations\nexport interface BeneficiaryData {\n beneficiary: Address;\n shares: bigint; // shares in WAD (1e18 = 100%)\n}\n\n// Pool status for lockable initializer\nexport enum LockablePoolStatus {\n Uninitialized = 0,\n Initialized = 1,\n Locked = 2,\n Exited = 3,\n}\n\n// Lockable pool state\nexport interface LockablePoolState {\n asset: Address;\n numeraire: Address;\n tickLower: number;\n tickUpper: number;\n maxShareToBeSold: bigint;\n totalTokensOnBondingCurve: bigint;\n status: LockablePoolStatus;\n}\n\n// Multicurve pool state (V4 initializer)\nexport interface MulticurvePoolState {\n asset: Address;\n numeraire: Address;\n fee: number;\n tickSpacing: number;\n status: LockablePoolStatus; // Reuses the same enum\n poolKey: V4PoolKey;\n farTick: number;\n}\n\n// Migration configuration (discriminated union)\nexport type MigrationConfig =\n | { type: 'uniswapV2' } // Basic migration to a new Uniswap v2 pool\n | {\n type: 'uniswapV4';\n fee: number;\n tickSpacing: number;\n // Configuration for fee streaming via StreamableFeesLocker (optional)\n // When omitted, fees are not locked and beneficiaries are not configured\n // This is useful when using noOp governance where lock duration is not meaningful\n streamableFees?: {\n lockDuration: number; // in seconds\n beneficiaries: BeneficiaryData[]; // Uses shares in WAD (1e18 = 100%)\n };\n }\n | { type: 'noOp' }; // No migration - used with lockable beneficiaries\n\n// Create Static Auction parameters\nexport interface CreateStaticAuctionParams<\n C extends SupportedChainId = SupportedChainId,\n> {\n // Token configuration\n token: TokenConfig;\n\n // Sale configuration\n sale: SaleConfig;\n\n // Static Auction (Uniswap v3) Pool configuration\n pool: StaticPoolConfig;\n\n // Vesting configuration (optional)\n vesting?: VestingConfig;\n\n // Governance configuration (required). Use `{ type: 'noOp' }` where enabled,\n // `{ type: 'default' }` for standard defaults, or `{ type: 'custom', ... }` to customize.\n governance: GovernanceOption<C>;\n\n // Explicit Migration Configuration\n migration: MigrationConfig;\n\n // Integrator details\n integrator?: Address;\n userAddress: Address;\n\n // Optional address overrides for on-chain modules used during encoding/creation\n modules?: ModuleAddressOverrides;\n\n // Optional transaction gas limit override for the create() transaction\n // If omitted, SDK will default to 13,500,000 gas for create()\n gas?: bigint;\n}\n\n// Create Dynamic Auction parameters\nexport interface CreateDynamicAuctionParams<\n C extends SupportedChainId = SupportedChainId,\n> {\n // Token configuration\n token: TokenConfig;\n\n // Sale configuration\n sale: SaleConfig;\n\n // Dynamic Auction (Uniswap v4 Hook) configuration\n auction: DynamicAuctionConfig;\n\n // Pool configuration\n pool: {\n fee: number; // e.g., 3000 for 0.3%\n tickSpacing: number;\n };\n\n // Vesting configuration (optional)\n vesting?: VestingConfig;\n\n // Governance configuration (required). Use `{ type: 'noOp' }` where enabled,\n // `{ type: 'default' }` for standard defaults, or `{ type: 'custom', ... }` to customize.\n governance: GovernanceOption<C>;\n\n // Explicit Migration Configuration\n migration: MigrationConfig;\n\n // Integrator details\n integrator?: Address;\n userAddress: Address;\n\n // Time configuration (internal use)\n startTimeOffset?: number;\n blockTimestamp?: number; // Optional: use this block timestamp instead of fetching latest\n\n // Optional transaction gas limit override for the create() transaction\n // If omitted, SDK will default to 13,500,000 gas for create()\n gas?: bigint;\n\n // Optional address overrides for on-chain modules used during encoding/creation\n modules?: ModuleAddressOverrides;\n}\n\n// Price range configuration for automatic tick calculation\nexport interface PriceRange {\n startPrice: number;\n endPrice: number;\n}\n\n// Tick range configuration\nexport interface TickRange {\n startTick: number;\n endTick: number;\n}\n\n// ============================================================================\n// Market Cap Configuration Types\n// ============================================================================\n\n/**\n * Market cap range in USD for price configurations.\n * Used to define start and end market caps for bonding curves.\n */\nexport interface MarketCapRange {\n /** Starting market cap in USD (e.g., 100_000 for $100k) */\n start: number;\n /** Ending market cap in USD (e.g., 10_000_000 for $10M) */\n end: number;\n}\n\n/**\n * Base configuration for market cap-based tick calculations.\n * Used by builder methods to convert market caps to ticks.\n */\nexport interface MarketCapConfig {\n /** Target market cap range in USD */\n marketCap: MarketCapRange;\n /** Price of numeraire in USD (e.g., 3000 for ETH at $3000) */\n numerairePrice: number;\n /**\n * Token supply override. If not provided, inferred from saleConfig.initialSupply.\n * Must include decimals (e.g., parseEther('1000000000') for 1B tokens).\n */\n tokenSupply?: bigint;\n /** Token decimals (default: 18) */\n tokenDecimals?: number;\n /** Numeraire decimals (default: 18) */\n numeraireDecimals?: number;\n}\n\n/**\n * Market cap configuration for V3 Static Auctions.\n * Extends base config with V3-specific parameters.\n */\nexport interface StaticAuctionMarketCapConfig extends MarketCapConfig {\n /** Fee tier in basis points (e.g., 10000 for 1%). Default: 10000 */\n fee?: number;\n /** Number of liquidity positions. Default: 15 */\n numPositions?: number;\n /** Maximum share of tokens to sell per position (WAD). Default: 35% */\n maxShareToBeSold?: bigint;\n}\n\n/**\n * Market cap range for V4 Dynamic Auctions (Dutch auctions).\n * Uses start/min because price descends from start to minimum.\n */\nexport interface DynamicMarketCapRange {\n /** Starting market cap in USD - auction begins here (e.g., 500_000 for $500k) */\n start: number;\n /** Minimum market cap in USD - floor price the auction descends to (e.g., 50_000 for $50k) */\n min: number;\n}\n\n/**\n * Market cap configuration for V4 Dynamic Auctions.\n * Uses start/min (not start/end) because Dutch auctions descend from start to minimum.\n */\nexport interface DynamicAuctionMarketCapConfig {\n /** Target market cap range (start = launch price, min = floor price) */\n marketCap: DynamicMarketCapRange;\n /** Price of numeraire in USD (e.g., 3000 for ETH at $3000) */\n numerairePrice: number;\n /**\n * Token supply override. If not provided, inferred from saleConfig.initialSupply.\n * Must include decimals (e.g., parseEther('1000000000') for 1B tokens).\n */\n tokenSupply?: bigint;\n /** Token decimals (default: 18) */\n tokenDecimals?: number;\n /** Numeraire decimals (default: 18) */\n numeraireDecimals?: number;\n /**\n * Pool fee in basis points. Default: 10000 (1%)\n *\n * V4 pools support any fee from 0 to 100,000 (10%).\n * Standard tiers (100, 500, 3000, 10000) auto-derive tickSpacing.\n * Custom fees require explicit tickSpacing parameter.\n */\n fee?: number;\n /**\n * Tick spacing for the pool. Required for custom fees.\n *\n * Must be <= 30 for Doppler pools (MAX_TICK_SPACING constraint).\n * If not provided with a standard fee tier, defaults to 30.\n */\n tickSpacing?: number;\n /** Minimum proceeds required for successful auction */\n minProceeds: bigint;\n /** Maximum proceeds cap for the auction */\n maxProceeds: bigint;\n /** Auction duration in seconds. Default: 7 days */\n duration?: number;\n /** Epoch length in seconds. Default: 3600 (1 hour) */\n epochLength?: number;\n /** Gamma (tick decay per epoch). Auto-calculated if not provided */\n gamma?: number;\n /** Number of price discovery slugs. Default: 5 */\n numPdSlugs?: number;\n}\n\n/**\n * Result of market cap parameter validation.\n */\nexport interface MarketCapValidationResult {\n /** Whether all parameters are within normal bounds */\n valid: boolean;\n /** Warning messages for unusual but technically valid values */\n warnings: string[];\n}\n\n// ============================================================================\n// Market Cap Helper Function Parameter Types\n// ============================================================================\n\n/**\n * Parameters for converting market cap range to ticks for V3 Static Auctions.\n */\nexport interface StaticAuctionTickParams {\n marketCapRange: MarketCapRange;\n tokenSupply: bigint;\n numerairePriceUSD: number;\n tickSpacing: number;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n}\n\n/**\n * Parameters for converting market cap range to ticks for V4 Dynamic Auctions.\n */\nexport interface DynamicAuctionTickParams {\n marketCapRange: MarketCapRange;\n tokenSupply: bigint;\n numerairePriceUSD: number;\n numeraire: Address;\n tickSpacing: number;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n}\n\n/**\n * Parameters for converting market cap range to ticks for V4 Multicurve pools.\n */\nexport interface MulticurveTickRangeParams {\n marketCapLower: number;\n marketCapUpper: number | 'max';\n tokenSupply: bigint;\n numerairePriceUSD: number;\n tickSpacing: number;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n}\n\n/**\n * Parameters for converting a single market cap to a tick for Multicurve.\n */\nexport interface MulticurveTickParams {\n marketCapUSD: number;\n tokenSupply: bigint;\n numerairePriceUSD: number;\n tickSpacing: number;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n}\n\n/**\n * Parameters for converting a tick to market cap (reverse conversion).\n */\nexport interface TickToMarketCapParams {\n tick: number;\n tokenSupply: bigint;\n numerairePriceUSD: number;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n}\n\n// ============================================================================\n// New Multicurve Market Cap API (no tick math required)\n// ============================================================================\n\n/**\n * Curve configuration for Multicurve pools using market cap ranges.\n * Each curve defines a market cap range and liquidity distribution.\n */\nexport interface MulticurveMarketCapRangeCurve {\n /** Market cap range for this curve */\n marketCap: {\n /** Start market cap in USD (for the first curve, this is the launch price) */\n start: number;\n /** End market cap in USD, or 'max' for MAX_TICK rounded to tick spacing */\n end: number | 'max';\n };\n /** Number of liquidity positions in this curve */\n numPositions: number;\n /** Share of total supply allocated to this curve (WAD, e.g., parseEther('0.3') = 30%) */\n shares: bigint;\n}\n\n/**\n * Market cap-based configuration for Multicurve pools.\n * No tick math required - just specify market caps in USD.\n */\nexport interface MulticurveMarketCapCurvesConfig {\n /** Price of numeraire in USD (e.g., 3000 for ETH at $3000) */\n numerairePrice: number;\n /**\n * Array of curves defining market cap ranges and liquidity distribution.\n * The first curve's marketCap.start is the launch price.\n * Curves must be contiguous (no gaps allowed).\n */\n curves: MulticurveMarketCapRangeCurve[];\n /** Token supply override */\n tokenSupply?: bigint;\n /** Token decimals (default: 18) */\n tokenDecimals?: number;\n /** Numeraire decimals (default: 18) */\n numeraireDecimals?: number;\n /** Fee tier (default: FEE_TIERS.LOW) */\n fee?: number;\n /** Tick spacing (derived from fee if not provided) */\n tickSpacing?: number;\n /** Optional beneficiaries for fee streaming */\n beneficiaries?: BeneficiaryData[];\n}\n\n// Build configuration for static auctions (V3-style)\nexport interface StaticAuctionBuildConfig {\n // Token details\n name: string;\n symbol: string;\n totalSupply?: bigint; // default: 1 billion\n numTokensToSell?: bigint; // default: 900 million\n tokenURI: string;\n\n // Time parameters\n startTimeOffset?: number; // Optional - seconds to add to current block timestamp (default: 30)\n\n // Price parameters - must provide either priceRange or tickRange\n numeraire: Address; // Required for V3\n tickRange?: TickRange;\n priceRange?: PriceRange;\n fee?: number; // default: 10000 (1%)\n\n // Pool parameters (V3 specific)\n numPositions?: number; // default: 15\n maxShareToBeSold?: bigint; // default: 35% in WAD\n\n // Vesting parameters\n yearlyMintRate?: bigint; // default: 2%\n vestingDuration?: bigint; // default: 1 year\n recipients?: Address[]; // defaults to [userAddress]\n amounts?: bigint[]; // defaults based on pre-mint calculation\n\n // Migration configuration\n migration: MigrationConfig;\n\n // Other parameters\n integrator?: Address;\n useGovernance?: boolean; // default: true\n}\n\n// Build configuration for dynamic auctions (V4-style)\nexport interface DynamicAuctionBuildConfig {\n // Token details\n name: string;\n symbol: string;\n totalSupply: bigint;\n numTokensToSell: bigint;\n tokenURI: string;\n\n // Time parameters\n startTimeOffset?: number; // Optional - seconds to add to block timestamp (default: 30)\n blockTimestamp?: number; // Optional - specific block timestamp to use (default: fetch latest)\n duration?: number; // in seconds (default: 604800 = 7 days)\n epochLength?: number; // in seconds (default: 3600)\n\n // Price parameters - must provide either priceRange or tickRange\n numeraire?: Address; // defaults to zero address\n tickRange?: TickRange;\n priceRange?: PriceRange;\n tickSpacing: number;\n gamma?: number; // auto-calculated if not provided\n fee: number; // In basis points\n\n // Sale parameters\n minProceeds: bigint;\n maxProceeds: bigint;\n numPdSlugs?: number; // default: 5\n\n // Vesting parameters\n yearlyMintRate?: bigint; // default: 2%\n vestingDuration: bigint;\n recipients: Address[];\n amounts: bigint[];\n\n // Migration configuration\n migration: MigrationConfig;\n\n // Other parameters\n integrator?: Address;\n useGovernance?: boolean; // default: true\n}\n\n// SDK initialization configuration\nexport interface DopplerSDKConfig {\n publicClient: SupportedPublicClient;\n walletClient?: WalletClient;\n chainId: number;\n}\n\n// Pool information types\nexport interface PoolInfo {\n address: Address;\n tokenAddress: Address;\n numeraireAddress: Address;\n fee: number;\n liquidity: bigint;\n sqrtPriceX96: bigint;\n}\n\nexport interface HookInfo {\n hookAddress: Address;\n tokenAddress: Address;\n numeraireAddress: Address;\n poolId: string;\n currentEpoch: number;\n totalProceeds: bigint;\n totalTokensSold: bigint;\n earlyExit: boolean;\n insufficientProceeds: boolean;\n startingTime: bigint;\n endingTime: bigint;\n epochLength: bigint;\n minimumProceeds: bigint;\n maximumProceeds: bigint;\n}\n\n// Quote result type\nexport interface QuoteResult {\n amountOut: bigint;\n priceImpact: number;\n fee: bigint;\n route: string[];\n}\n\n// Lockable Uniswap V3 Initializer encode params\nexport interface LockableV3InitializerParams {\n fee: number;\n tickLower: number;\n tickUpper: number;\n numPositions: number;\n maxShareToBeSold: bigint;\n beneficiaries: BeneficiaryData[];\n}\n\n// Multicurve curve configuration (mirrors solidity struct)\nexport interface MulticurveCurve {\n tickLower: number; // int24\n tickUpper: number; // int24\n numPositions: number; // uint16\n shares: bigint; // uint256 (WAD)\n}\n\nexport type MulticurveMarketCapPreset = 'low' | 'medium' | 'high';\n\nexport interface V4PoolKey {\n currency0: Address;\n currency1: Address;\n fee: number;\n tickSpacing: number;\n hooks: Address;\n}\n\nexport interface MulticurveBundleExactOutResult {\n asset: Address;\n poolKey: V4PoolKey;\n amountIn: bigint;\n gasEstimate: bigint;\n}\n\nexport interface MulticurveBundleExactInResult {\n asset: Address;\n poolKey: V4PoolKey;\n amountOut: bigint;\n gasEstimate: bigint;\n}\n\n// RehypeDopplerHook configuration for fee distribution and buyback\nexport interface RehypeDopplerHookConfig {\n // The hook contract address (must be whitelisted in the initializer)\n hookAddress: Address;\n // Destination address for buyback tokens\n buybackDestination: Address;\n // Custom swap fee in basis points (e.g., 3000 = 0.3%)\n customFee: number;\n // Fee distribution percentages (must sum to 100% / WAD)\n // Percentage of fees used for asset buyback (in WAD, e.g., 0.2e18 = 20%)\n assetBuybackPercentWad: bigint;\n // Percentage of fees used for numeraire buyback (in WAD, e.g., 0.2e18 = 20%)\n numeraireBuybackPercentWad: bigint;\n // Percentage of fees distributed to beneficiaries (in WAD, e.g., 0.3e18 = 30%)\n beneficiaryPercentWad: bigint;\n // Percentage of fees distributed to LPs (in WAD, e.g., 0.3e18 = 30%)\n lpPercentWad: bigint;\n // Optional graduation calldata (called when pool graduates)\n graduationCalldata?: `0x${string}`;\n\n // Graduation threshold configuration (rehype-only)\n // Market cap in USD at which pool can graduate. Requires numerairePrice (from withCurves() or explicit).\n graduationMarketCap?: number;\n // Price of numeraire in USD. Optional if using withCurves() (reuses that value). Required with poolConfig().\n numerairePrice?: number;\n // Direct tick value for graduation threshold. Use graduationMarketCap for USD-based config.\n farTick?: number;\n}\n\n// Decay fee schedule state for multicurve pools using a dynamic-fee hook\nexport interface MulticurveDecayFeeSchedule {\n startingTime: number;\n startFee: number;\n endFee: number;\n lastFee: number;\n durationSeconds: number;\n}\n\nexport type MulticurveInitializerConfig =\n | { type: 'standard' }\n | { type: 'scheduled'; startTime: number }\n | {\n type: 'decay';\n startTime: number;\n startFee: number;\n durationSeconds: number;\n }\n | { type: 'rehype'; config: RehypeDopplerHookConfig };\n\n// Create Multicurve initializer parameters\nexport interface CreateMulticurveParams<\n C extends SupportedChainId = SupportedChainId,\n> {\n // Token configuration\n token: TokenConfig;\n\n // Sale configuration\n sale: SaleConfig;\n\n // Pool configuration for multicurve initializer\n pool: {\n // For decay initializer mode, this is the terminal fee (endFee).\n fee: number;\n tickSpacing: number;\n curves: MulticurveCurve[];\n // Optional beneficiaries to lock the pool (fee collection only, no migration)\n beneficiaries?: BeneficiaryData[];\n };\n\n // Preferred initializer configuration. Defaults to { type: 'standard' }.\n initializer?: MulticurveInitializerConfig;\n\n /**\n * @deprecated Use initializer: { type: 'scheduled', startTime } instead.\n * Retained for backwards compatibility.\n */\n // Optional scheduled launch configuration\n schedule?: {\n startTime: number;\n };\n\n /**\n * @deprecated Use initializer: { type: 'rehype', config } instead.\n * Retained for backwards compatibility.\n */\n dopplerHook?: RehypeDopplerHookConfig;\n\n // Vesting configuration (optional)\n vesting?: VestingConfig;\n\n // Governance configuration\n governance: GovernanceOption<C>;\n\n // Migration configuration (can be any supported migrator: V2, V3, or V4)\n migration: MigrationConfig;\n\n // Integrator details\n integrator?: Address;\n userAddress: Address;\n\n // Optional address overrides for on-chain modules used during encoding/creation\n modules?: ModuleAddressOverrides;\n\n // Optional transaction gas limit override for the create() transaction\n gas?: bigint;\n}\n\n// Final Params object that gets passed as arg to create\nexport interface CreateParams {\n initialSupply: bigint;\n numTokensToSell: bigint;\n numeraire: Address;\n tokenFactory: Address;\n tokenFactoryData: `0x${string}`;\n governanceFactory: Address;\n governanceFactoryData: `0x${string}`;\n poolInitializer: Address;\n poolInitializerData: `0x${string}`;\n liquidityMigrator: Address;\n liquidityMigratorData: `0x${string}`;\n integrator: Address;\n salt: `0x${string}`;\n}\n\n// Optional per-call module address overrides. When provided, these take precedence\n// over chain defaults resolved via getAddresses(chainId).\nexport interface ModuleAddressOverrides {\n // Core deployment & routing\n airlock?: Address;\n tokenFactory?: Address;\n\n // Initializers\n v3Initializer?: Address;\n lockableV3Initializer?: Address;\n v4Initializer?: Address;\n v4MulticurveInitializer?: Address;\n v4ScheduledMulticurveInitializer?: Address;\n v4DecayMulticurveInitializer?: Address;\n dopplerHookInitializer?: Address;\n\n // DopplerHooks\n rehypeDopplerHook?: Address;\n\n // Governance\n governanceFactory?: Address;\n\n // Dynamic auction infra\n poolManager?: Address;\n dopplerDeployer?: Address;\n\n // Migrators\n v2Migrator?: Address;\n v4Migrator?: Address;\n noOpMigrator?: Address;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { ADDRESSES } from './chunk-O2DZH23A.mjs';
1
+ import { ADDRESSES } from './chunk-CYY5IATT.mjs';
2
2
 
3
3
  // src/utils/airlock.ts
4
4
  var airlockAbi = [
@@ -36,5 +36,5 @@ var getAirlockBeneficiary = async (publicClient, shares = DEFAULT_AIRLOCK_BENEFI
36
36
  };
37
37
 
38
38
  export { DEFAULT_AIRLOCK_BENEFICIARY_SHARES, createAirlockBeneficiary, getAirlockBeneficiary, getAirlockOwner };
39
- //# sourceMappingURL=chunk-5ZPBKSNS.mjs.map
40
- //# sourceMappingURL=chunk-5ZPBKSNS.mjs.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;AAC7B,EAAA,MAAM,KAAA,GAAQ,MAAM,eAAA,CAAgB,YAAY,CAAA;AAChD,EAAA,OAAO,wBAAA,CAAyB,OAAO,MAAM,CAAA;AAC/C","file":"chunk-5ZPBKSNS.mjs","sourcesContent":["import type { PublicClient, Address } from 'viem';\nimport { ADDRESSES, type SupportedChainId } from '../addresses';\nimport type { BeneficiaryData } from '../types';\n\nconst airlockAbi = [\n {\n type: 'function',\n name: 'owner',\n inputs: [],\n outputs: [{ name: '', type: 'address', internalType: 'address' }],\n stateMutability: 'view',\n },\n] as const;\n\nexport const getAirlockOwner = async (\n publicClient: unknown,\n): Promise<Address> => {\n const client = publicClient as PublicClient;\n const chainId = client.chain?.id as SupportedChainId | undefined;\n if (!chainId || !ADDRESSES[chainId]) {\n throw new Error('Unsupported chain ID for airlock owner lookup');\n }\n\n const airlockAddress = ADDRESSES[chainId].airlock;\n\n const owner = await client.readContract({\n address: airlockAddress,\n abi: airlockAbi,\n functionName: 'owner',\n });\n\n if (!owner) throw new Error('Airlock owner not found');\n return owner as Address;\n};\n\n// Default airlock beneficiary shares (5% = 0.05e18 WAD)\nexport const DEFAULT_AIRLOCK_BENEFICIARY_SHARES = BigInt(5e16); // 5% in WAD\n\nexport const createAirlockBeneficiary = (\n owner: Address,\n shares: bigint = DEFAULT_AIRLOCK_BENEFICIARY_SHARES,\n): BeneficiaryData => ({\n beneficiary: owner,\n shares,\n});\n\nexport const getAirlockBeneficiary = async (\n publicClient: unknown,\n shares: bigint = DEFAULT_AIRLOCK_BENEFICIARY_SHARES,\n): Promise<BeneficiaryData> => {\n const owner = await getAirlockOwner(publicClient);\n return createAirlockBeneficiary(owner, shares);\n};\n"]}
1
+ {"version":3,"sources":["../src/utils/airlock.ts"],"names":[],"mappings":";;;AAIA,IAAM,UAAA,GAAa;AAAA,EACjB;AAAA,IACE,IAAA,EAAM,UAAA;AAAA,IACN,IAAA,EAAM,OAAA;AAAA,IACN,QAAQ,EAAC;AAAA,IACT,OAAA,EAAS,CAAC,EAAE,IAAA,EAAM,IAAI,IAAA,EAAM,SAAA,EAAW,YAAA,EAAc,SAAA,EAAW,CAAA;AAAA,IAChE,eAAA,EAAiB;AAAA;AAErB,CAAA;AAEO,IAAM,eAAA,GAAkB,OAC7B,YAAA,KACqB;AACrB,EAAA,MAAM,MAAA,GAAS,YAAA;AACf,EAAA,MAAM,OAAA,GAAU,OAAO,KAAA,EAAO,EAAA;AAC9B,EAAA,IAAI,CAAC,OAAA,IAAW,CAAC,SAAA,CAAU,OAAO,CAAA,EAAG;AACnC,IAAA,MAAM,IAAI,MAAM,+CAA+C,CAAA;AAAA,EACjE;AAEA,EAAA,MAAM,cAAA,GAAiB,SAAA,CAAU,OAAO,CAAA,CAAE,OAAA;AAE1C,EAAA,MAAM,KAAA,GAAQ,MAAM,MAAA,CAAO,YAAA,CAAa;AAAA,IACtC,OAAA,EAAS,cAAA;AAAA,IACT,GAAA,EAAK,UAAA;AAAA,IACL,YAAA,EAAc;AAAA,GACf,CAAA;AAED,EAAA,IAAI,CAAC,KAAA,EAAO,MAAM,IAAI,MAAM,yBAAyB,CAAA;AACrD,EAAA,OAAO,KAAA;AACT;AAGO,IAAM,kCAAA,GAAqC,OAAO,IAAI;AAEtD,IAAM,wBAAA,GAA2B,CACtC,KAAA,EACA,MAAA,GAAiB,kCAAA,MACI;AAAA,EACrB,WAAA,EAAa,KAAA;AAAA,EACb;AACF,CAAA;AAEO,IAAM,qBAAA,GAAwB,OACnC,YAAA,EACA,MAAA,GAAiB,kCAAA,KACY;AAC7B,EAAA,MAAM,KAAA,GAAQ,MAAM,eAAA,CAAgB,YAAY,CAAA;AAChD,EAAA,OAAO,wBAAA,CAAyB,OAAO,MAAM,CAAA;AAC/C","file":"chunk-UY4TVYEU.mjs","sourcesContent":["import type { PublicClient, Address } from 'viem';\nimport { ADDRESSES, type SupportedChainId } from '../addresses';\nimport type { BeneficiaryData } from '../types';\n\nconst airlockAbi = [\n {\n type: 'function',\n name: 'owner',\n inputs: [],\n outputs: [{ name: '', type: 'address', internalType: 'address' }],\n stateMutability: 'view',\n },\n] as const;\n\nexport const getAirlockOwner = async (\n publicClient: unknown,\n): Promise<Address> => {\n const client = publicClient as PublicClient;\n const chainId = client.chain?.id as SupportedChainId | undefined;\n if (!chainId || !ADDRESSES[chainId]) {\n throw new Error('Unsupported chain ID for airlock owner lookup');\n }\n\n const airlockAddress = ADDRESSES[chainId].airlock;\n\n const owner = await client.readContract({\n address: airlockAddress,\n abi: airlockAbi,\n functionName: 'owner',\n });\n\n if (!owner) throw new Error('Airlock owner not found');\n return owner as Address;\n};\n\n// Default airlock beneficiary shares (5% = 0.05e18 WAD)\nexport const DEFAULT_AIRLOCK_BENEFICIARY_SHARES = BigInt(5e16); // 5% in WAD\n\nexport const createAirlockBeneficiary = (\n owner: Address,\n shares: bigint = DEFAULT_AIRLOCK_BENEFICIARY_SHARES,\n): BeneficiaryData => ({\n beneficiary: owner,\n shares,\n});\n\nexport const getAirlockBeneficiary = async (\n publicClient: unknown,\n shares: bigint = DEFAULT_AIRLOCK_BENEFICIARY_SHARES,\n): Promise<BeneficiaryData> => {\n const owner = await getAirlockOwner(publicClient);\n return createAirlockBeneficiary(owner, shares);\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkZ7ZGPSQF_js = require('./chunk-Z7ZGPSQF.js');
4
- var chunkLOVD3NCN_js = require('./chunk-LOVD3NCN.js');
3
+ var chunkP4BT5GDO_js = require('./chunk-P4BT5GDO.js');
4
+ var chunk3MVW6UIW_js = require('./chunk-3MVW6UIW.js');
5
5
  var viem = require('viem');
6
6
 
7
7
  var StaticAuction = class {
@@ -25,35 +25,35 @@ var StaticAuction = class {
25
25
  const [slot0, liquidity, token0, token1, fee] = await Promise.all([
26
26
  this.rpc.readContract({
27
27
  address: this.poolAddress,
28
- abi: chunkLOVD3NCN_js.uniswapV3PoolAbi,
28
+ abi: chunk3MVW6UIW_js.uniswapV3PoolAbi,
29
29
  functionName: "slot0"
30
30
  }),
31
31
  this.rpc.readContract({
32
32
  address: this.poolAddress,
33
- abi: chunkLOVD3NCN_js.uniswapV3PoolAbi,
33
+ abi: chunk3MVW6UIW_js.uniswapV3PoolAbi,
34
34
  functionName: "liquidity"
35
35
  }),
36
36
  this.rpc.readContract({
37
37
  address: this.poolAddress,
38
- abi: chunkLOVD3NCN_js.uniswapV3PoolAbi,
38
+ abi: chunk3MVW6UIW_js.uniswapV3PoolAbi,
39
39
  functionName: "token0"
40
40
  }),
41
41
  this.rpc.readContract({
42
42
  address: this.poolAddress,
43
- abi: chunkLOVD3NCN_js.uniswapV3PoolAbi,
43
+ abi: chunk3MVW6UIW_js.uniswapV3PoolAbi,
44
44
  functionName: "token1"
45
45
  }),
46
46
  this.rpc.readContract({
47
47
  address: this.poolAddress,
48
- abi: chunkLOVD3NCN_js.uniswapV3PoolAbi,
48
+ abi: chunk3MVW6UIW_js.uniswapV3PoolAbi,
49
49
  functionName: "fee"
50
50
  })
51
51
  ]);
52
52
  const chainId = await this.rpc.getChainId();
53
- const addresses = chunkZ7ZGPSQF_js.getAddresses(chainId);
53
+ const addresses = chunkP4BT5GDO_js.getAddresses(chainId);
54
54
  const assetData = await this.rpc.readContract({
55
55
  address: addresses.airlock,
56
- abi: chunkLOVD3NCN_js.airlockAbi,
56
+ abi: chunk3MVW6UIW_js.airlockAbi,
57
57
  functionName: "getAssetData",
58
58
  args: [token0]
59
59
  });
@@ -87,10 +87,10 @@ var StaticAuction = class {
87
87
  async hasGraduated() {
88
88
  const tokenAddress = await this.getTokenAddress();
89
89
  const chainId = await this.rpc.getChainId();
90
- const addresses = chunkZ7ZGPSQF_js.getAddresses(chainId);
90
+ const addresses = chunkP4BT5GDO_js.getAddresses(chainId);
91
91
  const assetData = await this.rpc.readContract({
92
92
  address: addresses.airlock,
93
- abi: chunkLOVD3NCN_js.airlockAbi,
93
+ abi: chunk3MVW6UIW_js.airlockAbi,
94
94
  functionName: "getAssetData",
95
95
  args: [tokenAddress]
96
96
  });
@@ -106,12 +106,12 @@ var StaticAuction = class {
106
106
  const [token0] = await Promise.all([
107
107
  this.rpc.readContract({
108
108
  address: this.poolAddress,
109
- abi: chunkLOVD3NCN_js.uniswapV3PoolAbi,
109
+ abi: chunk3MVW6UIW_js.uniswapV3PoolAbi,
110
110
  functionName: "token0"
111
111
  }),
112
112
  this.rpc.readContract({
113
113
  address: this.poolAddress,
114
- abi: chunkLOVD3NCN_js.uniswapV3PoolAbi,
114
+ abi: chunk3MVW6UIW_js.uniswapV3PoolAbi,
115
115
  functionName: "token1"
116
116
  })
117
117
  ]);
@@ -132,12 +132,12 @@ var StaticAuction = class {
132
132
  async getTotalLiquidity() {
133
133
  return await this.rpc.readContract({
134
134
  address: this.poolAddress,
135
- abi: chunkLOVD3NCN_js.uniswapV3PoolAbi,
135
+ abi: chunk3MVW6UIW_js.uniswapV3PoolAbi,
136
136
  functionName: "liquidity"
137
137
  });
138
138
  }
139
139
  };
140
140
 
141
141
  exports.StaticAuction = StaticAuction;
142
- //# sourceMappingURL=chunk-PQUS2LCD.js.map
143
- //# sourceMappingURL=chunk-PQUS2LCD.js.map
142
+ //# sourceMappingURL=chunk-UZTVXZP3.js.map
143
+ //# sourceMappingURL=chunk-UZTVXZP3.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/entities/auction/StaticAuction.ts"],"names":["uniswapV3PoolAbi","getAddresses","airlockAbi","zeroAddress"],"mappings":";;;;;;AAWO,IAAM,gBAAN,MAAoB;AAAA,EAGzB,IAAY,GAAA,GAAoB;AAC9B,IAAA,OAAO,IAAA,CAAK,MAAA;AAAA,EACd;AAAA,EAEA,WAAA,CAAY,QAA+B,WAAA,EAAsB;AAC/D,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AACd,IAAA,IAAA,CAAK,WAAA,GAAc,WAAA;AAAA,EACrB;AAAA;AAAA;AAAA;AAAA,EAKA,UAAA,GAAsB;AACpB,IAAA,OAAO,IAAA,CAAK,WAAA;AAAA,EACd;AA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AAA,EAAKA,iCAAA;AAAA,MACL,YAAA,EAAc;AAAA,KACf,CAAA;AAAA,EACH;AACF","file":"chunk-PQUS2LCD.js","sourcesContent":["import { type Address, zeroAddress, type PublicClient } from 'viem';\nimport type { PoolInfo, SupportedPublicClient } from '../../types';\nimport { uniswapV3PoolAbi, airlockAbi } from '../../abis';\nimport { getAddresses } from '../../addresses';\n\n/**\n * StaticAuction class for interacting with static auctions (Uniswap V3 based)\n *\n * Static auctions use a fixed price range on Uniswap V3 for initial liquidity bootstrapping.\n * This is ideal for simple, predictable price discovery events.\n */\nexport class StaticAuction {\n private client: SupportedPublicClient;\n private poolAddress: Address;\n private get rpc(): PublicClient {\n return this.client as PublicClient;\n }\n\n constructor(client: SupportedPublicClient, poolAddress: Address) {\n this.client = client;\n this.poolAddress = poolAddress;\n }\n\n /**\n * Get the pool address\n */\n getAddress(): Address {\n return this.poolAddress;\n }\n\n /**\n * Get current pool information\n */\n async getPoolInfo(): Promise<PoolInfo> {\n // Fetch all pool data in parallel\n const [slot0, liquidity, token0, token1, fee] = await Promise.all([\n this.rpc.readContract({\n address: this.poolAddress,\n abi: uniswapV3PoolAbi,\n functionName: 'slot0',\n }),\n this.rpc.readContract({\n address: this.poolAddress,\n abi: uniswapV3PoolAbi,\n functionName: 'liquidity',\n }),\n this.rpc.readContract({\n address: this.poolAddress,\n abi: uniswapV3PoolAbi,\n functionName: 'token0',\n }),\n this.rpc.readContract({\n address: this.poolAddress,\n abi: uniswapV3PoolAbi,\n functionName: 'token1',\n }),\n this.rpc.readContract({\n address: this.poolAddress,\n abi: uniswapV3PoolAbi,\n functionName: 'fee',\n }),\n ]);\n\n // Determine which token is the auction token and which is numeraire\n // This requires checking with the Airlock contract\n const chainId = await this.rpc.getChainId();\n const addresses = getAddresses(chainId);\n\n const assetData = await this.rpc.readContract({\n address: addresses.airlock,\n abi: airlockAbi,\n functionName: 'getAssetData',\n args: [token0],\n });\n // Determine whether token0 is the auction token.\n // Handle both tuple and object return shapes from getAssetData.\n // Tuple (legacy): [numeraire, timelock, governance, liquidityMigrator, poolInitializer, pool, ...]\n // Object (unified): { poolOrHook, liquidityMigrator, numeraire, ... }\n let poolOrHook0: any;\n if (Array.isArray(assetData)) {\n poolOrHook0 = assetData[5];\n } else if (assetData && typeof assetData === 'object') {\n poolOrHook0 = (assetData as any).poolOrHook ?? (assetData as any).pool;\n }\n const isToken0AuctionToken = poolOrHook0 && poolOrHook0 !== zeroAddress;\n\n return {\n address: this.poolAddress,\n tokenAddress: isToken0AuctionToken ? token0 : token1,\n numeraireAddress: isToken0AuctionToken ? token1 : token0,\n fee,\n liquidity,\n sqrtPriceX96: slot0[0], // First element is sqrtPriceX96\n };\n }\n\n /**\n * Get the token address for this auction\n */\n async getTokenAddress(): Promise<Address> {\n const poolInfo = await this.getPoolInfo();\n return poolInfo.tokenAddress;\n }\n\n /**\n * Check if the auction has graduated (ready for migration)\n */\n async hasGraduated(): Promise<boolean> {\n const tokenAddress = await this.getTokenAddress();\n const chainId = await this.rpc.getChainId();\n const addresses = getAddresses(chainId);\n\n const assetData = await this.rpc.readContract({\n address: addresses.airlock,\n abi: airlockAbi,\n functionName: 'getAssetData',\n args: [tokenAddress],\n });\n // Check if the asset is graduated (liquidityMigrator is zero)\n const liquidityMigrator = Array.isArray(assetData)\n ? (assetData as any)[3]\n : (assetData as any)?.liquidityMigrator;\n return liquidityMigrator === zeroAddress;\n }\n\n /**\n * Get the current price in the pool\n * Returns the price of token in terms of numeraire (token/numeraire)\n */\n async getCurrentPrice(): Promise<bigint> {\n const poolInfo = await this.getPoolInfo();\n\n // Get token ordering\n const [token0] = await Promise.all([\n this.rpc.readContract({\n address: this.poolAddress,\n abi: uniswapV3PoolAbi,\n functionName: 'token0',\n }),\n this.rpc.readContract({\n address: this.poolAddress,\n abi: uniswapV3PoolAbi,\n functionName: 'token1',\n }),\n ]);\n\n // Calculate price from sqrtPriceX96\n // sqrtPriceX96 = sqrt(price) * 2^96\n // price = (sqrtPriceX96 / 2^96)^2\n const sqrtPriceX96 = poolInfo.sqrtPriceX96;\n const Q96 = BigInt(2) ** BigInt(96);\n\n // price0 = amount of token1 per token0\n const sqrtPriceX96Squared = sqrtPriceX96 * sqrtPriceX96;\n const Q96Squared = Q96 * Q96;\n const price0 = sqrtPriceX96Squared / Q96Squared;\n\n // Return price based on which token is the auction token\n if (poolInfo.tokenAddress === token0) {\n // Auction token is token0, return price in terms of token1 (numeraire)\n return price0;\n } else {\n // Auction token is token1, return reciprocal price\n // price1 = 1 / price0 (with precision handling)\n return Q96Squared / price0;\n }\n }\n\n /**\n * Get total liquidity in the pool\n */\n async getTotalLiquidity(): Promise<bigint> {\n return await this.rpc.readContract({\n address: this.poolAddress,\n abi: uniswapV3PoolAbi,\n functionName: 'liquidity',\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/entities/auction/StaticAuction.ts"],"names":["uniswapV3PoolAbi","getAddresses","airlockAbi","zeroAddress"],"mappings":";;;;;;AAWO,IAAM,gBAAN,MAAoB;AAAA,EAGzB,IAAY,GAAA,GAAoB;AAC9B,IAAA,OAAO,IAAA,CAAK,MAAA;AAAA,EACd;AAAA,EAEA,WAAA,CAAY,QAA+B,WAAA,EAAsB;AAC/D,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AACd,IAAA,IAAA,CAAK,WAAA,GAAc,WAAA;AAAA,EACrB;AAAA;AAAA;AAAA;AAAA,EAKA,UAAA,GAAsB;AACpB,IAAA,OAAO,IAAA,CAAK,WAAA;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,WAAA,GAAiC;AAErC,IAAA,MAAM,CAAC,OAAO,SAAA,EAAW,MAAA,EAAQ,QAAQ,GAAG,CAAA,GAAI,MAAM,OAAA,CAAQ,GAAA,CAAI;AAAA,MAChE,IAAA,CAAK,IAAI,YAAA,CAAa;AAAA,QACpB,SAAS,IAAA,CAAK,WAAA;AAAA,QACd,GAAA,EAAKA,iCAAA;AAAA,QACL,YAAA,EAAc;AAAA,O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M,CAAC,MAAM,CAAA,GAAI,MAAM,QAAQ,GAAA,CAAI;AAAA,MACjC,IAAA,CAAK,IAAI,YAAA,CAAa;AAAA,QACpB,SAAS,IAAA,CAAK,WAAA;AAAA,QACd,GAAA,EAAKH,iCAAA;AAAA,QACL,YAAA,EAAc;AAAA,OACf,CAAA;AAAA,MACD,IAAA,CAAK,IAAI,YAAA,CAAa;AAAA,QACpB,SAAS,IAAA,CAAK,WAAA;AAAA,QACd,GAAA,EAAKA,iCAAA;AAAA,QACL,YAAA,EAAc;AAAA,OACf;AAAA,KACF,CAAA;AAKD,IAAA,MAAM,eAAe,QAAA,CAAS,YAAA;AAC9B,IAAA,MAAM,GAAA,GAAM,MAAA,CAAO,CAAC,CAAA,IAAK,OAAO,EAAE,CAAA;AAGlC,IAAA,MAAM,sBAAsB,YAAA,GAAe,YAAA;AAC3C,IAAA,MAAM,aAAa,GAAA,GAAM,GAAA;AACzB,IAAA,MAAM,SAAS,mBAAA,GAAsB,UAAA;AAGrC,IAAA,IAAI,QAAA,CAAS,iBAAiB,MAAA,EAAQ;AAEpC,MAAA,OAAO,MAAA;AAAA,IACT,CAAA,MAAO;AAGL,MAAA,OAAO,UAAA,GAAa,MAAA;AAAA,IACtB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,iBAAA,GAAqC;AACzC,IAAA,OAAO,MAAM,IAAA,CAAK,GAAA,CAAI,YAAA,CAAa;AAAA,MACjC,SAAS,IAAA,CAAK,WAAA;AAAA,MACd,GAAA,EAAKA,iCAAA;AAAA,MACL,YAAA,EAAc;AAAA,KACf,CAAA;AAAA,EACH;AACF","file":"chunk-UZTVXZP3.js","sourcesContent":["import { type Address, zeroAddress, type PublicClient } from 'viem';\nimport type { PoolInfo, SupportedPublicClient } from '../../types';\nimport { uniswapV3PoolAbi, airlockAbi } from '../../abis';\nimport { getAddresses } from '../../addresses';\n\n/**\n * StaticAuction class for interacting with static auctions (Uniswap V3 based)\n *\n * Static auctions use a fixed price range on Uniswap V3 for initial liquidity bootstrapping.\n * This is ideal for simple, predictable price discovery events.\n */\nexport class StaticAuction {\n private client: SupportedPublicClient;\n private poolAddress: Address;\n private get rpc(): PublicClient {\n return this.client as PublicClient;\n }\n\n constructor(client: SupportedPublicClient, poolAddress: Address) {\n this.client = client;\n this.poolAddress = poolAddress;\n }\n\n /**\n * Get the pool address\n */\n getAddress(): Address {\n return this.poolAddress;\n }\n\n /**\n * Get current pool information\n */\n async getPoolInfo(): Promise<PoolInfo> {\n // Fetch all pool data in parallel\n const [slot0, liquidity, token0, token1, fee] = await Promise.all([\n this.rpc.readContract({\n address: this.poolAddress,\n abi: uniswapV3PoolAbi,\n functionName: 'slot0',\n }),\n this.rpc.readContract({\n address: this.poolAddress,\n abi: uniswapV3PoolAbi,\n functionName: 'liquidity',\n }),\n this.rpc.readContract({\n address: this.poolAddress,\n abi: uniswapV3PoolAbi,\n functionName: 'token0',\n }),\n this.rpc.readContract({\n address: this.poolAddress,\n abi: uniswapV3PoolAbi,\n functionName: 'token1',\n }),\n this.rpc.readContract({\n address: this.poolAddress,\n abi: uniswapV3PoolAbi,\n functionName: 'fee',\n }),\n ]);\n\n // Determine which token is the auction token and which is numeraire\n // This requires checking with the Airlock contract\n const chainId = await this.rpc.getChainId();\n const addresses = getAddresses(chainId);\n\n const assetData = await this.rpc.readContract({\n address: addresses.airlock,\n abi: airlockAbi,\n functionName: 'getAssetData',\n args: [token0],\n });\n // Determine whether token0 is the auction token.\n // Handle both tuple and object return shapes from getAssetData.\n // Tuple (legacy): [numeraire, timelock, governance, liquidityMigrator, poolInitializer, pool, ...]\n // Object (unified): { poolOrHook, liquidityMigrator, numeraire, ... }\n let poolOrHook0: any;\n if (Array.isArray(assetData)) {\n poolOrHook0 = assetData[5];\n } else if (assetData && typeof assetData === 'object') {\n poolOrHook0 = (assetData as any).poolOrHook ?? (assetData as any).pool;\n }\n const isToken0AuctionToken = poolOrHook0 && poolOrHook0 !== zeroAddress;\n\n return {\n address: this.poolAddress,\n tokenAddress: isToken0AuctionToken ? token0 : token1,\n numeraireAddress: isToken0AuctionToken ? token1 : token0,\n fee,\n liquidity,\n sqrtPriceX96: slot0[0], // First element is sqrtPriceX96\n };\n }\n\n /**\n * Get the token address for this auction\n */\n async getTokenAddress(): Promise<Address> {\n const poolInfo = await this.getPoolInfo();\n return poolInfo.tokenAddress;\n }\n\n /**\n * Check if the auction has graduated (ready for migration)\n */\n async hasGraduated(): Promise<boolean> {\n const tokenAddress = await this.getTokenAddress();\n const chainId = await this.rpc.getChainId();\n const addresses = getAddresses(chainId);\n\n const assetData = await this.rpc.readContract({\n address: addresses.airlock,\n abi: airlockAbi,\n functionName: 'getAssetData',\n args: [tokenAddress],\n });\n // Check if the asset is graduated (liquidityMigrator is zero)\n const liquidityMigrator = Array.isArray(assetData)\n ? (assetData as any)[3]\n : (assetData as any)?.liquidityMigrator;\n return liquidityMigrator === zeroAddress;\n }\n\n /**\n * Get the current price in the pool\n * Returns the price of token in terms of numeraire (token/numeraire)\n */\n async getCurrentPrice(): Promise<bigint> {\n const poolInfo = await this.getPoolInfo();\n\n // Get token ordering\n const [token0] = await Promise.all([\n this.rpc.readContract({\n address: this.poolAddress,\n abi: uniswapV3PoolAbi,\n functionName: 'token0',\n }),\n this.rpc.readContract({\n address: this.poolAddress,\n abi: uniswapV3PoolAbi,\n functionName: 'token1',\n }),\n ]);\n\n // Calculate price from sqrtPriceX96\n // sqrtPriceX96 = sqrt(price) * 2^96\n // price = (sqrtPriceX96 / 2^96)^2\n const sqrtPriceX96 = poolInfo.sqrtPriceX96;\n const Q96 = BigInt(2) ** BigInt(96);\n\n // price0 = amount of token1 per token0\n const sqrtPriceX96Squared = sqrtPriceX96 * sqrtPriceX96;\n const Q96Squared = Q96 * Q96;\n const price0 = sqrtPriceX96Squared / Q96Squared;\n\n // Return price based on which token is the auction token\n if (poolInfo.tokenAddress === token0) {\n // Auction token is token0, return price in terms of token1 (numeraire)\n return price0;\n } else {\n // Auction token is token1, return reciprocal price\n // price1 = 1 / price0 (with precision handling)\n return Q96Squared / price0;\n }\n }\n\n /**\n * Get total liquidity in the pool\n */\n async getTotalLiquidity(): Promise<bigint> {\n return await this.rpc.readContract({\n address: this.poolAddress,\n abi: uniswapV3PoolAbi,\n functionName: 'liquidity',\n });\n }\n}\n"]}