@whetstone-research/doppler-sdk 0.0.20 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/dist/DopplerSDK.js +13 -13
- package/dist/DopplerSDK.mjs +12 -12
- package/dist/addresses.d.mts +1 -0
- package/dist/addresses.d.ts +1 -0
- package/dist/addresses.js +6 -6
- package/dist/addresses.mjs +1 -1
- package/dist/builders/DynamicAuctionBuilder.js +5 -5
- package/dist/builders/DynamicAuctionBuilder.mjs +4 -4
- package/dist/builders/MulticurveBuilder.js +5 -5
- package/dist/builders/MulticurveBuilder.mjs +4 -4
- package/dist/builders/StaticAuctionBuilder.js +5 -5
- package/dist/builders/StaticAuctionBuilder.mjs +4 -4
- package/dist/builders/index.js +9 -9
- package/dist/builders/index.mjs +6 -6
- package/dist/builders/shared.js +2 -2
- package/dist/builders/shared.mjs +2 -2
- package/dist/{chunk-Y5RAENN5.js → chunk-3L4DLMOK.js} +5 -5
- package/dist/{chunk-Y5RAENN5.js.map → chunk-3L4DLMOK.js.map} +1 -1
- package/dist/{chunk-GLMPU7VL.js → chunk-3XYDN2XB.js} +5 -5
- package/dist/{chunk-GLMPU7VL.js.map → chunk-3XYDN2XB.js.map} +1 -1
- package/dist/{chunk-JHPDKSC4.js → chunk-5VV7STYK.js} +40 -11
- package/dist/chunk-5VV7STYK.js.map +1 -0
- package/dist/{chunk-COUZYFEE.js → chunk-5WYXNWNH.js} +5 -5
- package/dist/{chunk-COUZYFEE.js.map → chunk-5WYXNWNH.js.map} +1 -1
- package/dist/{chunk-NWZGO2CH.mjs → chunk-ADAAU4F5.mjs} +40 -11
- package/dist/chunk-ADAAU4F5.mjs.map +1 -0
- package/dist/{chunk-RKPAL3SU.mjs → chunk-AZH2P4JK.mjs} +3 -3
- package/dist/{chunk-RKPAL3SU.mjs.map → chunk-AZH2P4JK.mjs.map} +1 -1
- package/dist/{chunk-AS5UUJRI.js → chunk-COOVGAOE.js} +13 -11
- package/dist/chunk-COOVGAOE.js.map +1 -0
- package/dist/{chunk-36Y3N257.mjs → chunk-CS6FVODR.mjs} +3 -3
- package/dist/{chunk-36Y3N257.mjs.map → chunk-CS6FVODR.mjs.map} +1 -1
- package/dist/{chunk-TYJZL2XZ.js → chunk-CUB4F546.js} +5 -5
- package/dist/{chunk-TYJZL2XZ.js.map → chunk-CUB4F546.js.map} +1 -1
- package/dist/{chunk-RJE6LWWF.mjs → chunk-D7PCIMWU.mjs} +3 -3
- package/dist/{chunk-RJE6LWWF.mjs.map → chunk-D7PCIMWU.mjs.map} +1 -1
- package/dist/{chunk-CXE33IZN.mjs → chunk-FVTTG72Z.mjs} +3 -3
- package/dist/{chunk-CXE33IZN.mjs.map → chunk-FVTTG72Z.mjs.map} +1 -1
- package/dist/{chunk-SKU6VE6L.mjs → chunk-HJ4AS5DZ.mjs} +11 -11
- package/dist/{chunk-SKU6VE6L.mjs.map → chunk-HJ4AS5DZ.mjs.map} +1 -1
- package/dist/{chunk-4CJS5XLY.js → chunk-INLXNN7P.js} +4 -4
- package/dist/{chunk-4CJS5XLY.js.map → chunk-INLXNN7P.js.map} +1 -1
- package/dist/{chunk-U7CHPFU6.mjs → chunk-KITPRKQ4.mjs} +3 -3
- package/dist/{chunk-U7CHPFU6.mjs.map → chunk-KITPRKQ4.mjs.map} +1 -1
- package/dist/{chunk-BFJGY436.mjs → chunk-M2EMKIP5.mjs} +5 -3
- package/dist/chunk-M2EMKIP5.mjs.map +1 -0
- package/dist/{chunk-3SCK4LGS.js → chunk-MT34O3YL.js} +24 -24
- package/dist/{chunk-3SCK4LGS.js.map → chunk-MT34O3YL.js.map} +1 -1
- package/dist/{chunk-XEWKLVOD.mjs → chunk-O3RH43H3.mjs} +3 -3
- package/dist/{chunk-XEWKLVOD.mjs.map → chunk-O3RH43H3.mjs.map} +1 -1
- package/dist/{chunk-GFOBDFVW.js → chunk-QQEOKYEX.js} +17 -17
- package/dist/{chunk-GFOBDFVW.js.map → chunk-QQEOKYEX.js.map} +1 -1
- package/dist/{chunk-4LNXE5DF.mjs → chunk-RWVNXU7Z.mjs} +5 -5
- package/dist/{chunk-4LNXE5DF.mjs.map → chunk-RWVNXU7Z.mjs.map} +1 -1
- package/dist/{chunk-K27G7LLT.js → chunk-S4IZ5ATO.js} +5 -5
- package/dist/{chunk-K27G7LLT.js.map → chunk-S4IZ5ATO.js.map} +1 -1
- package/dist/{chunk-HHHCRTC7.js → chunk-WKKOBMXR.js} +5 -5
- package/dist/{chunk-HHHCRTC7.js.map → chunk-WKKOBMXR.js.map} +1 -1
- package/dist/{chunk-V7YRKFYK.mjs → chunk-YWK6YH6M.mjs} +3 -3
- package/dist/{chunk-V7YRKFYK.mjs.map → chunk-YWK6YH6M.mjs.map} +1 -1
- package/dist/{chunk-J2E2GILK.js → chunk-ZDTJ3BPS.js} +13 -13
- package/dist/{chunk-J2E2GILK.js.map → chunk-ZDTJ3BPS.js.map} +1 -1
- package/dist/{chunk-NJYBKWCD.mjs → chunk-ZRNPHFP3.mjs} +3 -3
- package/dist/{chunk-NJYBKWCD.mjs.map → chunk-ZRNPHFP3.mjs.map} +1 -1
- package/dist/entities/DopplerFactory.js +4 -4
- package/dist/entities/DopplerFactory.mjs +3 -3
- package/dist/entities/auction/DynamicAuction.js +3 -3
- package/dist/entities/auction/DynamicAuction.mjs +2 -2
- package/dist/entities/auction/MulticurvePool.js +4 -4
- package/dist/entities/auction/MulticurvePool.mjs +3 -3
- package/dist/entities/auction/StaticAuction.js +3 -3
- package/dist/entities/auction/StaticAuction.mjs +2 -2
- package/dist/entities/auction/index.js +8 -8
- package/dist/entities/auction/index.mjs +5 -5
- package/dist/entities/quoter/Quoter.js +3 -3
- package/dist/entities/quoter/Quoter.mjs +2 -2
- package/dist/entities/quoter/index.js +3 -3
- package/dist/entities/quoter/index.mjs +2 -2
- package/dist/index.js +31 -31
- package/dist/index.mjs +12 -12
- package/dist/types.d.mts +3 -3
- package/dist/types.d.ts +3 -3
- package/dist/types.js +7 -7
- package/dist/types.mjs +2 -2
- package/dist/utils/airlock.js +6 -6
- package/dist/utils/airlock.mjs +2 -2
- package/dist/utils/index.js +6 -6
- package/dist/utils/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-AS5UUJRI.js.map +0 -1
- package/dist/chunk-BFJGY436.mjs.map +0 -1
- package/dist/chunk-JHPDKSC4.js.map +0 -1
- package/dist/chunk-NWZGO2CH.mjs.map +0 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { CHAIN_IDS } from './chunk-
|
|
1
|
+
import { CHAIN_IDS } from './chunk-ADAAU4F5.mjs';
|
|
2
2
|
|
|
3
3
|
// src/types.ts
|
|
4
4
|
var NO_OP_ENABLED_CHAIN_IDS = [
|
|
5
|
+
CHAIN_IDS.MAINNET,
|
|
6
|
+
CHAIN_IDS.ETH_SEPOLIA,
|
|
5
7
|
CHAIN_IDS.BASE,
|
|
6
8
|
CHAIN_IDS.BASE_SEPOLIA,
|
|
7
9
|
CHAIN_IDS.UNICHAIN,
|
|
@@ -28,5 +30,5 @@ var LockablePoolStatus = /* @__PURE__ */ ((LockablePoolStatus2) => {
|
|
|
28
30
|
})(LockablePoolStatus || {});
|
|
29
31
|
|
|
30
32
|
export { LAUNCHPAD_ENABLED_CHAIN_IDS, LockablePoolStatus, NO_OP_ENABLED_CHAIN_IDS, isLaunchpadEnabledChain, isNoOpEnabledChain };
|
|
31
|
-
//# sourceMappingURL=chunk-
|
|
32
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-M2EMKIP5.mjs.map
|
|
34
|
+
//# sourceMappingURL=chunk-M2EMKIP5.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"names":["LockablePoolStatus"],"mappings":";;;AA2EO,IAAM,uBAAA,GAA0B;AAAA,EACrC,SAAA,CAAU,OAAA;AAAA,EACV,SAAA,CAAU,WAAA;AAAA,EACV,SAAA,CAAU,IAAA;AAAA,EACV,SAAA,CAAU,YAAA;AAAA,EACV,SAAA,CAAU,QAAA;AAAA,EACV,SAAA,CAAU,gBAAA;AAAA,EACV,SAAA,CAAU,aAAA;AAAA,EACV,SAAA,CAAU;AACZ;AAOO,SAAS,mBACd,OAAA,EAC+B;AAC/B,EAAA,OAAQ,uBAAA,CAA8C,SAAS,OAAO,CAAA;AACxE;AAGO,IAAM,2BAAA,GAA8B;AAAA,EACzC,SAAA,CAAU,IAAA;AAAA,EACV,SAAA,CAAU;AACZ;AAQO,SAAS,wBACd,OAAA,EACoC;AACpC,EAAA,OAAQ,2BAAA,CAAkD,SAAS,OAAO,CAAA;AAC5E;AA8BO,IAAK,kBAAA,qBAAAA,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-M2EMKIP5.mjs","sourcesContent":["import { base, baseSepolia, ink, mainnet, sepolia, 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 mainnet\n | typeof sepolia\n | typeof base\n | typeof baseSepolia\n | typeof ink\n | typeof unichain;\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.MAINNET,\n CHAIN_IDS.ETH_SEPOLIA,\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,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkZDTJ3BPS_js = require('./chunk-ZDTJ3BPS.js');
|
|
4
4
|
var chunkRXUJ4DUB_js = require('./chunk-RXUJ4DUB.js');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
5
|
+
var chunkINLXNN7P_js = require('./chunk-INLXNN7P.js');
|
|
6
|
+
var chunkWKKOBMXR_js = require('./chunk-WKKOBMXR.js');
|
|
7
|
+
var chunk3L4DLMOK_js = require('./chunk-3L4DLMOK.js');
|
|
8
|
+
var chunkCUB4F546_js = require('./chunk-CUB4F546.js');
|
|
9
|
+
var chunk3XYDN2XB_js = require('./chunk-3XYDN2XB.js');
|
|
10
|
+
var chunk5WYXNWNH_js = require('./chunk-5WYXNWNH.js');
|
|
11
|
+
var chunkQQEOKYEX_js = require('./chunk-QQEOKYEX.js');
|
|
12
|
+
var chunkS4IZ5ATO_js = require('./chunk-S4IZ5ATO.js');
|
|
13
13
|
|
|
14
14
|
// src/DopplerSDK.ts
|
|
15
15
|
var DopplerSDK = class {
|
|
@@ -23,7 +23,7 @@ var DopplerSDK = class {
|
|
|
23
23
|
*/
|
|
24
24
|
get factory() {
|
|
25
25
|
if (!this._factory) {
|
|
26
|
-
this._factory = new
|
|
26
|
+
this._factory = new chunkQQEOKYEX_js.DopplerFactory(
|
|
27
27
|
this.publicClient,
|
|
28
28
|
this.walletClient,
|
|
29
29
|
this.chainId
|
|
@@ -36,7 +36,7 @@ var DopplerSDK = class {
|
|
|
36
36
|
*/
|
|
37
37
|
get quoter() {
|
|
38
38
|
if (!this._quoter) {
|
|
39
|
-
this._quoter = new
|
|
39
|
+
this._quoter = new chunkZDTJ3BPS_js.Quoter(this.publicClient, this.chainId);
|
|
40
40
|
}
|
|
41
41
|
return this._quoter;
|
|
42
42
|
}
|
|
@@ -45,21 +45,21 @@ var DopplerSDK = class {
|
|
|
45
45
|
* @param poolAddress The address of the Uniswap V3 pool
|
|
46
46
|
*/
|
|
47
47
|
async getStaticAuction(poolAddress) {
|
|
48
|
-
return new
|
|
48
|
+
return new chunk3L4DLMOK_js.StaticAuction(this.publicClient, poolAddress);
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* Get a DynamicAuction instance for interacting with a dynamic auction hook
|
|
52
52
|
* @param hookAddress The address of the Uniswap V4 hook
|
|
53
53
|
*/
|
|
54
54
|
async getDynamicAuction(hookAddress) {
|
|
55
|
-
return new
|
|
55
|
+
return new chunkINLXNN7P_js.DynamicAuction(this.publicClient, hookAddress);
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Get a MulticurvePool instance for interacting with a V4 multicurve pool
|
|
59
59
|
* @param tokenAddress The address of the token created by the auction (called "asset" in contracts; V4 pools don't have addresses, so the token is used as the lookup key)
|
|
60
60
|
*/
|
|
61
61
|
async getMulticurvePool(tokenAddress) {
|
|
62
|
-
return new
|
|
62
|
+
return new chunkWKKOBMXR_js.MulticurvePool(
|
|
63
63
|
this.publicClient,
|
|
64
64
|
this.walletClient,
|
|
65
65
|
tokenAddress
|
|
@@ -77,7 +77,7 @@ var DopplerSDK = class {
|
|
|
77
77
|
* @param poolAddress The address of the pool
|
|
78
78
|
*/
|
|
79
79
|
async getPoolInfo(poolAddress) {
|
|
80
|
-
const auction = new
|
|
80
|
+
const auction = new chunk3L4DLMOK_js.StaticAuction(this.publicClient, poolAddress);
|
|
81
81
|
return auction.getPoolInfo();
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
@@ -85,26 +85,26 @@ var DopplerSDK = class {
|
|
|
85
85
|
* @param hookAddress The address of the hook
|
|
86
86
|
*/
|
|
87
87
|
async getHookInfo(hookAddress) {
|
|
88
|
-
const auction = new
|
|
88
|
+
const auction = new chunkINLXNN7P_js.DynamicAuction(this.publicClient, hookAddress);
|
|
89
89
|
return auction.getHookInfo();
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
92
92
|
* Create a new static auction builder
|
|
93
93
|
*/
|
|
94
94
|
buildStaticAuction() {
|
|
95
|
-
return new
|
|
95
|
+
return new chunk5WYXNWNH_js.StaticAuctionBuilder(this.chainId);
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
98
|
* Create a new dynamic auction builder
|
|
99
99
|
*/
|
|
100
100
|
buildDynamicAuction() {
|
|
101
|
-
return new
|
|
101
|
+
return new chunkCUB4F546_js.DynamicAuctionBuilder(this.chainId);
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
104
|
* Create a new multicurve (V4 initializer) auction builder
|
|
105
105
|
*/
|
|
106
106
|
buildMulticurveAuction() {
|
|
107
|
-
return new
|
|
107
|
+
return new chunk3XYDN2XB_js.MulticurveBuilder(this.chainId);
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
110
|
* Get the current chain ID
|
|
@@ -125,16 +125,16 @@ var DopplerSDK = class {
|
|
|
125
125
|
* Get the airlock owner address for the configured chain
|
|
126
126
|
*/
|
|
127
127
|
async getAirlockOwner() {
|
|
128
|
-
return
|
|
128
|
+
return chunkS4IZ5ATO_js.getAirlockOwner(this.publicClient);
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
131
|
* Convenience helper for building the airlock beneficiary entry with the default 5% (0.05e18 WAD shares)
|
|
132
132
|
*/
|
|
133
|
-
async getAirlockBeneficiary(shares =
|
|
134
|
-
return
|
|
133
|
+
async getAirlockBeneficiary(shares = chunkS4IZ5ATO_js.DEFAULT_AIRLOCK_BENEFICIARY_SHARES) {
|
|
134
|
+
return chunkS4IZ5ATO_js.getAirlockBeneficiary(this.publicClient, shares);
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
137
|
|
|
138
138
|
exports.DopplerSDK = DopplerSDK;
|
|
139
|
-
//# sourceMappingURL=chunk-
|
|
140
|
-
//# sourceMappingURL=chunk-
|
|
139
|
+
//# sourceMappingURL=chunk-MT34O3YL.js.map
|
|
140
|
+
//# sourceMappingURL=chunk-MT34O3YL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/DopplerSDK.ts"],"names":["DopplerFactory","Quoter","StaticAuction","DynamicAuction","MulticurvePool","Derc20","StaticAuctionBuilder","DynamicAuctionBuilder","MulticurveBuilder","getAirlockOwner","DEFAULT_AIRLOCK_BENEFICIARY_SHARES","getAirlockBeneficiary"],"mappings":";;;;;;;;;;;;;;AA4BO,IAAM,aAAN,MAAgE;AAAA,EAOrE,YAAY,MAAA,EAA0B;AACpC,IAAA,IAAA,CAAK,eAAe,MAAA,CAAO,YAAA;AAC3B,IAAA,IAAA,CAAK,eAAe,MAAA,CAAO,YAAA;AAC3B,IAAA,IAAA,CAAK,UAAU,MAAA,CAAO,OAAA;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,OAAA,GAA6B;AAC/B,IAAA,IAAI,CAAC,KAAK,QAAA,EAAU;AAClB,MAAA,IAAA,CAAK,WAAW,IAAIA,+BAAA;AAAA,QAClB,IAAA,CAAK,YAAA;AAAA,QACL,IAAA,CAAK,YAAA;AAAA,QACL,IAAA,CAAK;AAA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,GAAU,IAAIC,+BAAA,CAAe,IAAA,CAAK,cAAc,WAAW,CAAA;AACjE,IAAA,OAAO,QAAQ,WAAA,EAAY;AAAA,EAC7B;AAAA;AAAA;AAAA;AAAA,EAKA,kBAAA,GAA8C;AAC5C,IAAA,OAAO,IAAIG,qCAAA,CAAqB,IAAA,CAAK,OAAO,CAAA;AAAA,EAC9C;AAAA;AAAA;AAAA;AAAA,EAKA,mBAAA,GAAgD;AAC9C,IAAA,OAAO,IAAIC,sCAAA,CAAsB,IAAA,CAAK,OAAO,CAAA;AAAA,EAC/C;AAAA;AAAA;AAAA;AAAA,EAKA,sBAAA,GAA+C;AAC7C,IAAA,OAAO,IAAIC,kCAAA,CAAkB,IAAA,CAAK,OAAO,CAAA;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA,EAKA,UAAA,GAAgB;AACd,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,UAAA,GAGE;AACA,IAAA,OAAO;AAAA,MACL,cAAc,IAAA,CAAK,YAAA;AAAA,MACnB,cAAc,IAAA,CAAK;AAAA,KACrB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,eAAA,GAAoC;AACxC,IAAA,OAAOC,gCAAA,CAAkB,KAAK,YAAY,CAAA;AAAA,EAC5C;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,qBAAA,CACJ,MAAA,GAAiBC,mDAAA,EACS;AAC1B,IAAA,OAAOC,sCAAA,CAAsB,IAAA,CAAK,YAAA,EAAc,MAAM,CAAA;AAAA,EACxD;AACF","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/DopplerSDK.ts"],"names":["DopplerFactory","Quoter","StaticAuction","DynamicAuction","MulticurvePool","Derc20","StaticAuctionBuilder","DynamicAuctionBuilder","MulticurveBuilder","getAirlockOwner","DEFAULT_AIRLOCK_BENEFICIARY_SHARES","getAirlockBeneficiary"],"mappings":";;;;;;;;;;;;;;AA4BO,I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,YAAY,CAAA;AAAA,EAC5C;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,qBAAA,CACJ,MAAA,GAAiBC,mDAAA,EACS;AAC1B,IAAA,OAAOC,sCAAA,CAAsB,IAAA,CAAK,YAAA,EAAc,MAAM,CAAA;AAAA,EACxD;AACF","file":"chunk-MT34O3YL.js","sourcesContent":["import type { Address, WalletClient } from 'viem';\nimport type {\n BeneficiaryData,\n DopplerSDKConfig,\n HookInfo,\n PoolInfo,\n SupportedPublicClient,\n} from './types';\nimport type { SupportedChainId } from './addresses';\nimport { DopplerFactory } from './entities/DopplerFactory';\nimport {\n StaticAuction,\n DynamicAuction,\n MulticurvePool,\n} from './entities/auction';\nimport { Quoter } from './entities/quoter';\nimport { Derc20 } from './entities/token';\nimport {\n StaticAuctionBuilder,\n DynamicAuctionBuilder,\n MulticurveBuilder,\n} from './builders';\nimport {\n DEFAULT_AIRLOCK_BENEFICIARY_SHARES,\n getAirlockBeneficiary,\n getAirlockOwner as fetchAirlockOwner,\n} from './utils/airlock';\n\nexport class DopplerSDK<C extends SupportedChainId = SupportedChainId> {\n private publicClient: SupportedPublicClient;\n private walletClient?: WalletClient;\n public chainId: C;\n private _factory?: DopplerFactory<C>;\n private _quoter?: Quoter;\n\n constructor(config: DopplerSDKConfig) {\n this.publicClient = config.publicClient;\n this.walletClient = config.walletClient;\n this.chainId = config.chainId as unknown as C;\n }\n\n /**\n * Get the factory instance for creating auctions\n */\n get factory(): DopplerFactory<C> {\n if (!this._factory) {\n this._factory = new DopplerFactory(\n this.publicClient,\n this.walletClient,\n this.chainId,\n );\n }\n return this._factory;\n }\n\n /**\n * Get the quoter instance for price queries\n */\n get quoter(): Quoter {\n if (!this._quoter) {\n this._quoter = new Quoter(this.publicClient, this.chainId);\n }\n return this._quoter;\n }\n\n /**\n * Get a StaticAuction instance for interacting with a static auction pool\n * @param poolAddress The address of the Uniswap V3 pool\n */\n async getStaticAuction(poolAddress: Address): Promise<StaticAuction> {\n return new StaticAuction(this.publicClient, poolAddress);\n }\n\n /**\n * Get a DynamicAuction instance for interacting with a dynamic auction hook\n * @param hookAddress The address of the Uniswap V4 hook\n */\n async getDynamicAuction(hookAddress: Address): Promise<DynamicAuction> {\n return new DynamicAuction(this.publicClient, hookAddress);\n }\n\n /**\n * Get a MulticurvePool instance for interacting with a V4 multicurve pool\n * @param tokenAddress The address of the token created by the auction (called \"asset\" in contracts; V4 pools don't have addresses, so the token is used as the lookup key)\n */\n async getMulticurvePool(tokenAddress: Address): Promise<MulticurvePool> {\n return new MulticurvePool(\n this.publicClient,\n this.walletClient,\n tokenAddress,\n );\n }\n\n /**\n * Get a DERC20 token instance for interacting with a token\n * @param tokenAddress The address of the DERC20 token\n */\n getDerc20(tokenAddress: Address): Derc20 {\n return new Derc20(this.publicClient, this.walletClient, tokenAddress);\n }\n\n /**\n * Get information about a static auction pool\n * @param poolAddress The address of the pool\n */\n async getPoolInfo(poolAddress: Address): Promise<PoolInfo> {\n const auction = new StaticAuction(this.publicClient, poolAddress);\n return auction.getPoolInfo();\n }\n\n /**\n * Get information about a dynamic auction hook\n * @param hookAddress The address of the hook\n */\n async getHookInfo(hookAddress: Address): Promise<HookInfo> {\n const auction = new DynamicAuction(this.publicClient, hookAddress);\n return auction.getHookInfo();\n }\n\n /**\n * Create a new static auction builder\n */\n buildStaticAuction(): StaticAuctionBuilder<C> {\n return new StaticAuctionBuilder(this.chainId);\n }\n\n /**\n * Create a new dynamic auction builder\n */\n buildDynamicAuction(): DynamicAuctionBuilder<C> {\n return new DynamicAuctionBuilder(this.chainId);\n }\n\n /**\n * Create a new multicurve (V4 initializer) auction builder\n */\n buildMulticurveAuction(): MulticurveBuilder<C> {\n return new MulticurveBuilder(this.chainId);\n }\n\n /**\n * Get the current chain ID\n */\n getChainId(): C {\n return this.chainId;\n }\n\n /**\n * Get the underlying clients\n */\n getClients(): {\n publicClient: SupportedPublicClient;\n walletClient?: WalletClient;\n } {\n return {\n publicClient: this.publicClient,\n walletClient: this.walletClient,\n };\n }\n\n /**\n * Get the airlock owner address for the configured chain\n */\n async getAirlockOwner(): Promise<Address> {\n return fetchAirlockOwner(this.publicClient);\n }\n\n /**\n * Convenience helper for building the airlock beneficiary entry with the default 5% (0.05e18 WAD shares)\n */\n async getAirlockBeneficiary(\n shares: bigint = DEFAULT_AIRLOCK_BENEFICIARY_SHARES,\n ): Promise<BeneficiaryData> {\n return getAirlockBeneficiary(this.publicClient, shares);\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getAddresses } from './chunk-
|
|
1
|
+
import { getAddresses } from './chunk-ADAAU4F5.mjs';
|
|
2
2
|
import { dopplerHookAbi, airlockAbi } from './chunk-E2NF4AQB.mjs';
|
|
3
3
|
import { zeroAddress, encodeAbiParameters, keccak256 } from 'viem';
|
|
4
4
|
|
|
@@ -291,5 +291,5 @@ var DynamicAuction = class {
|
|
|
291
291
|
};
|
|
292
292
|
|
|
293
293
|
export { DynamicAuction };
|
|
294
|
-
//# sourceMappingURL=chunk-
|
|
295
|
-
//# sourceMappingURL=chunk-
|
|
294
|
+
//# sourceMappingURL=chunk-O3RH43H3.mjs.map
|
|
295
|
+
//# sourceMappingURL=chunk-O3RH43H3.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/entities/auction/DynamicAuction.ts"],"names":[],"mappings":";;;;AAkBO,IAAM,iBAAN,MAAqB;AAAA,EAG1B,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;AAAA;AAAA,EAOA,MAAM,iBAAA,CAAkB,IAAA,EAAW,aAAA,GAAwB,CAAA,EAAkB;AAC3E,IAAA,MAAM,KAAK,GAAA,CA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C,SAAS,IAAA,CAAK,WAAA;AAAA,MACd,GAAA,EAAK,cAAA;AAAA,MACL,YAAA,EAAc;AAAA,KACf,CAAA;AACD,IAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,MAAM,CAAA,EAAG;AACzB,MAAA,MAAM;AAAA,QACJ,SAAA;AAAA,QACA,eAAA;AAAA,QACA,eAAA;AAAA,QACA,aAAA;AAAA,QACA,wBAAA;AAAA,QACA;AAAA,OACF,GAAI,MAAA;AACJ,MAAA,OAAO;AAAA,QACL,SAAA;AAAA,QACA,eAAA;AAAA,QACA,eAAA;AAAA,QACA,aAAA;AAAA,QACA,wBAAA;AAAA,QACA;AAAA,OACF;AAAA,IACF;AACA,IAAA,OAAO,MAAA;AAAA,EACT;AAAA,EAEQ,iBAAiB,KAAA,EAMvB;AACA,IAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxB,MAAA,MAAM,CAAC,SAAA,EAAW,SAAA,EAAW,GAAA,EAAK,WAAA,EAAa,KAAK,CAAA,GAAI,KAAA;AAOxD,MAAA,OAAO,EAAE,SAAA,EAAW,SAAA,EAAW,GAAA,EAAK,aAAa,KAAA,EAAM;AAAA,IACzD;AACA,IAAA,OAAO,KAAA;AAAA,EACT;AACF","file":"chunk-XEWKLVOD.mjs","sourcesContent":["import {\n type Address,\n type PublicClient,\n type Hex,\n keccak256,\n encodeAbiParameters,\n zeroAddress,\n} from 'viem';\nimport type { HookInfo, SupportedPublicClient } from '../../types';\nimport { dopplerHookAbi, airlockAbi } from '../../abis';\nimport { getAddresses } from '../../addresses';\n\n/**\n * DynamicAuction class for interacting with dynamic auctions (Uniswap V4 hook based)\n *\n * Dynamic auctions use a Uniswap V4 hook to create a gradual Dutch auction\n * where the price moves dynamically over time according to set parameters.\n */\nexport class DynamicAuction {\n private client: SupportedPublicClient;\n private hookAddress: Address;\n private get rpc(): PublicClient {\n return this.client as PublicClient;\n }\n\n constructor(client: SupportedPublicClient, hookAddress: Address) {\n this.client = client;\n this.hookAddress = hookAddress;\n }\n\n /**\n * Wait for a transaction to be confirmed and the contract to be ready for reads\n * @param hash - Transaction hash to wait for\n * @param confirmations - Number of block confirmations to wait for (default: 2)\n */\n async waitForDeployment(hash: Hex, confirmations: number = 2): Promise<void> {\n await this.rpc.waitForTransactionReceipt({ hash, confirmations });\n }\n\n /**\n * Get the hook address\n */\n getAddress(): Address {\n return this.hookAddress;\n }\n\n /**\n * Get current hook information\n */\n async getHookInfo(): Promise<HookInfo> {\n // Fetch all hook data in parallel\n const [\n state,\n earlyExit,\n insufficientProceeds,\n poolKeyRaw,\n startingTime,\n endingTime,\n epochLength,\n minimumProceeds,\n maximumProceeds,\n ] = await Promise.all([\n this.readHookState(),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'earlyExit',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'insufficientProceeds',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'poolKey',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'startingTime',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'endingTime',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'epochLength',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'minimumProceeds',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'maximumProceeds',\n }),\n ]);\n\n // Calculate current epoch\n const currentTime = BigInt(Math.floor(Date.now() / 1000));\n const elapsedTime =\n currentTime > startingTime ? currentTime - startingTime : BigInt(0);\n const currentEpoch =\n epochLength > 0n ? Number(elapsedTime / epochLength) : 0;\n\n // Determine token addresses from poolKey\n const poolKey = this.normalizePoolKey(poolKeyRaw as any);\n const isToken0 = poolKey.currency0 !== zeroAddress;\n const tokenAddress = isToken0 ? poolKey.currency0 : poolKey.currency1;\n const numeraireAddress = isToken0 ? poolKey.currency1 : poolKey.currency0;\n\n // Compute pool ID\n const poolId = this.computePoolId(poolKey);\n\n return {\n hookAddress: this.hookAddress,\n tokenAddress,\n numeraireAddress,\n poolId,\n currentEpoch,\n totalProceeds: (state as any).totalProceeds,\n totalTokensSold: (state as any).totalTokensSold,\n earlyExit,\n insufficientProceeds,\n startingTime,\n endingTime,\n epochLength,\n minimumProceeds,\n maximumProceeds,\n };\n }\n\n /**\n * Get the token address for this auction\n */\n async getTokenAddress(): Promise<Address> {\n const poolKeyRaw = await this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'poolKey',\n });\n const poolKey = this.normalizePoolKey(poolKeyRaw as any);\n\n const isToken0 = await this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'isToken0',\n });\n\n return isToken0 ? poolKey.currency0 : poolKey.currency1;\n }\n\n /**\n * Get the pool ID for this auction\n */\n async getPoolId(): Promise<string> {\n const poolKeyRaw = await this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'poolKey',\n });\n const poolKey = this.normalizePoolKey(poolKeyRaw as any);\n return this.computePoolId(poolKey);\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 epoch\n */\n async getCurrentEpoch(): Promise<number> {\n const [startingTime, epochLength] = await Promise.all([\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'startingTime',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'epochLength',\n }),\n ]);\n\n const currentTime = BigInt(Math.floor(Date.now() / 1000));\n const elapsedTime =\n currentTime > startingTime ? currentTime - startingTime : BigInt(0);\n\n return Number(elapsedTime / epochLength);\n }\n\n /**\n * Get the current price in the auction\n * Returns the current tick based on the epoch and gamma parameters\n */\n async getCurrentPrice(): Promise<bigint> {\n const [_state, startingTick, endingTick, gamma, startingTime, epochLength] =\n await Promise.all([\n this.readHookState(),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'startingTick',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'endingTick',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'gamma',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'startingTime',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'epochLength',\n }),\n ]);\n\n // Calculate current epoch\n const currentTime = BigInt(Math.floor(Date.now() / 1000));\n const elapsedTime =\n currentTime > startingTime ? currentTime - startingTime : BigInt(0);\n const currentEpoch =\n epochLength > 0n ? Number(elapsedTime / epochLength) : 0;\n\n // Calculate current tick based on the auction progression\n // The tick moves from startingTick towards endingTick based on epochs and gamma\n const direction = endingTick > startingTick ? 1 : -1;\n const tickMovement = Math.floor(currentEpoch * gamma * direction);\n const currentTick = Math.floor(startingTick + tickMovement);\n\n // Convert tick to price\n // price = 1.0001^tick\n // For simplicity, returning the tick as bigint for now\n // In production, you'd convert this to actual price using TickMath\n return BigInt(currentTick);\n }\n\n /**\n * Get total proceeds collected so far\n */\n async getTotalProceeds(): Promise<bigint> {\n const state = await this.readHookState();\n\n return (state as any).totalProceeds;\n }\n\n /**\n * Check if the auction ended early due to max proceeds\n */\n async hasEndedEarly(): Promise<boolean> {\n return await this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'earlyExit',\n });\n }\n\n /**\n * Compute V4 pool ID from pool key components\n */\n private computePoolId(poolKey: {\n currency0: Address;\n currency1: Address;\n fee: number;\n tickSpacing: number;\n hooks: Address;\n }): string {\n // V4 pools are identified by the hash of their PoolKey\n const encoded = encodeAbiParameters(\n [\n { type: 'address' },\n { type: 'address' },\n { type: 'uint24' },\n { type: 'int24' },\n { type: 'address' },\n ],\n [\n poolKey.currency0,\n poolKey.currency1,\n poolKey.fee,\n poolKey.tickSpacing,\n poolKey.hooks,\n ],\n );\n return keccak256(encoded);\n }\n\n /**\n * Read hook state with backward-compatible decoding.\n * Falls back to legacy state() ABI if the latest ABI fails to decode.\n */\n private async readHookState(): Promise<any> {\n const result: any = await this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'state',\n });\n if (Array.isArray(result)) {\n const [\n lastEpoch,\n tickAccumulator,\n totalTokensSold,\n totalProceeds,\n totalTokensSoldLastEpoch,\n feesAccrued,\n ] = result as any[];\n return {\n lastEpoch,\n tickAccumulator,\n totalTokensSold,\n totalProceeds,\n totalTokensSoldLastEpoch,\n feesAccrued,\n };\n }\n return result;\n }\n\n private normalizePoolKey(value: any): {\n currency0: Address;\n currency1: Address;\n fee: number;\n tickSpacing: number;\n hooks: Address;\n } {\n if (Array.isArray(value)) {\n const [currency0, currency1, fee, tickSpacing, hooks] = value as [\n Address,\n Address,\n number,\n number,\n Address,\n ];\n return { currency0, currency1, fee, tickSpacing, hooks };\n }\n return value as any;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/entities/auction/DynamicAuction.ts"],"names":[],"mappings":";;;;AAkBO,IAAM,iBAAN,MAAqB;AAAA,EAG1B,IAAY,GAAA,GAAoB;AAC9B,IAAA,OAAO,IAAA,CAAK,MAAA;AAAA,EACd;AAAA,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AAQ,GAAA;AAAA,QACR,OAAA,CAAQ,WAAA;AAAA,QACR,OAAA,CAAQ;AAAA;AACV,KACF;AACA,IAAA,OAAO,UAAU,OAAO,CAAA;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAc,aAAA,GAA8B;AAC1C,IAAA,MAAM,MAAA,GAAc,MAAM,IAAA,CAAK,GAAA,CAAI,YAAA,CAAa;AAAA,MAC9C,SAAS,IAAA,CAAK,WAAA;AAAA,MACd,GAAA,EAAK,cAAA;AAAA,MACL,YAAA,EAAc;AAAA,KACf,CAAA;AACD,IAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,MAAM,CAAA,EAAG;AACzB,MAAA,MAAM;AAAA,QACJ,SAAA;AAAA,QACA,eAAA;AAAA,QACA,eAAA;AAAA,QACA,aAAA;AAAA,QACA,wBAAA;AAAA,QACA;AAAA,OACF,GAAI,MAAA;AACJ,MAAA,OAAO;AAAA,QACL,SAAA;AAAA,QACA,eAAA;AAAA,QACA,eAAA;AAAA,QACA,aAAA;AAAA,QACA,wBAAA;AAAA,QACA;AAAA,OACF;AAAA,IACF;AACA,IAAA,OAAO,MAAA;AAAA,EACT;AAAA,EAEQ,iBAAiB,KAAA,EAMvB;AACA,IAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxB,MAAA,MAAM,CAAC,SAAA,EAAW,SAAA,EAAW,GAAA,EAAK,WAAA,EAAa,KAAK,CAAA,GAAI,KAAA;AAOxD,MAAA,OAAO,EAAE,SAAA,EAAW,SAAA,EAAW,GAAA,EAAK,aAAa,KAAA,EAAM;AAAA,IACzD;AACA,IAAA,OAAO,KAAA;AAAA,EACT;AACF","file":"chunk-O3RH43H3.mjs","sourcesContent":["import {\n type Address,\n type PublicClient,\n type Hex,\n keccak256,\n encodeAbiParameters,\n zeroAddress,\n} from 'viem';\nimport type { HookInfo, SupportedPublicClient } from '../../types';\nimport { dopplerHookAbi, airlockAbi } from '../../abis';\nimport { getAddresses } from '../../addresses';\n\n/**\n * DynamicAuction class for interacting with dynamic auctions (Uniswap V4 hook based)\n *\n * Dynamic auctions use a Uniswap V4 hook to create a gradual Dutch auction\n * where the price moves dynamically over time according to set parameters.\n */\nexport class DynamicAuction {\n private client: SupportedPublicClient;\n private hookAddress: Address;\n private get rpc(): PublicClient {\n return this.client as PublicClient;\n }\n\n constructor(client: SupportedPublicClient, hookAddress: Address) {\n this.client = client;\n this.hookAddress = hookAddress;\n }\n\n /**\n * Wait for a transaction to be confirmed and the contract to be ready for reads\n * @param hash - Transaction hash to wait for\n * @param confirmations - Number of block confirmations to wait for (default: 2)\n */\n async waitForDeployment(hash: Hex, confirmations: number = 2): Promise<void> {\n await this.rpc.waitForTransactionReceipt({ hash, confirmations });\n }\n\n /**\n * Get the hook address\n */\n getAddress(): Address {\n return this.hookAddress;\n }\n\n /**\n * Get current hook information\n */\n async getHookInfo(): Promise<HookInfo> {\n // Fetch all hook data in parallel\n const [\n state,\n earlyExit,\n insufficientProceeds,\n poolKeyRaw,\n startingTime,\n endingTime,\n epochLength,\n minimumProceeds,\n maximumProceeds,\n ] = await Promise.all([\n this.readHookState(),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'earlyExit',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'insufficientProceeds',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'poolKey',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'startingTime',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'endingTime',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'epochLength',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'minimumProceeds',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'maximumProceeds',\n }),\n ]);\n\n // Calculate current epoch\n const currentTime = BigInt(Math.floor(Date.now() / 1000));\n const elapsedTime =\n currentTime > startingTime ? currentTime - startingTime : BigInt(0);\n const currentEpoch =\n epochLength > 0n ? Number(elapsedTime / epochLength) : 0;\n\n // Determine token addresses from poolKey\n const poolKey = this.normalizePoolKey(poolKeyRaw as any);\n const isToken0 = poolKey.currency0 !== zeroAddress;\n const tokenAddress = isToken0 ? poolKey.currency0 : poolKey.currency1;\n const numeraireAddress = isToken0 ? poolKey.currency1 : poolKey.currency0;\n\n // Compute pool ID\n const poolId = this.computePoolId(poolKey);\n\n return {\n hookAddress: this.hookAddress,\n tokenAddress,\n numeraireAddress,\n poolId,\n currentEpoch,\n totalProceeds: (state as any).totalProceeds,\n totalTokensSold: (state as any).totalTokensSold,\n earlyExit,\n insufficientProceeds,\n startingTime,\n endingTime,\n epochLength,\n minimumProceeds,\n maximumProceeds,\n };\n }\n\n /**\n * Get the token address for this auction\n */\n async getTokenAddress(): Promise<Address> {\n const poolKeyRaw = await this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'poolKey',\n });\n const poolKey = this.normalizePoolKey(poolKeyRaw as any);\n\n const isToken0 = await this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'isToken0',\n });\n\n return isToken0 ? poolKey.currency0 : poolKey.currency1;\n }\n\n /**\n * Get the pool ID for this auction\n */\n async getPoolId(): Promise<string> {\n const poolKeyRaw = await this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'poolKey',\n });\n const poolKey = this.normalizePoolKey(poolKeyRaw as any);\n return this.computePoolId(poolKey);\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 epoch\n */\n async getCurrentEpoch(): Promise<number> {\n const [startingTime, epochLength] = await Promise.all([\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'startingTime',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'epochLength',\n }),\n ]);\n\n const currentTime = BigInt(Math.floor(Date.now() / 1000));\n const elapsedTime =\n currentTime > startingTime ? currentTime - startingTime : BigInt(0);\n\n return Number(elapsedTime / epochLength);\n }\n\n /**\n * Get the current price in the auction\n * Returns the current tick based on the epoch and gamma parameters\n */\n async getCurrentPrice(): Promise<bigint> {\n const [_state, startingTick, endingTick, gamma, startingTime, epochLength] =\n await Promise.all([\n this.readHookState(),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'startingTick',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'endingTick',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'gamma',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'startingTime',\n }),\n this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'epochLength',\n }),\n ]);\n\n // Calculate current epoch\n const currentTime = BigInt(Math.floor(Date.now() / 1000));\n const elapsedTime =\n currentTime > startingTime ? currentTime - startingTime : BigInt(0);\n const currentEpoch =\n epochLength > 0n ? Number(elapsedTime / epochLength) : 0;\n\n // Calculate current tick based on the auction progression\n // The tick moves from startingTick towards endingTick based on epochs and gamma\n const direction = endingTick > startingTick ? 1 : -1;\n const tickMovement = Math.floor(currentEpoch * gamma * direction);\n const currentTick = Math.floor(startingTick + tickMovement);\n\n // Convert tick to price\n // price = 1.0001^tick\n // For simplicity, returning the tick as bigint for now\n // In production, you'd convert this to actual price using TickMath\n return BigInt(currentTick);\n }\n\n /**\n * Get total proceeds collected so far\n */\n async getTotalProceeds(): Promise<bigint> {\n const state = await this.readHookState();\n\n return (state as any).totalProceeds;\n }\n\n /**\n * Check if the auction ended early due to max proceeds\n */\n async hasEndedEarly(): Promise<boolean> {\n return await this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'earlyExit',\n });\n }\n\n /**\n * Compute V4 pool ID from pool key components\n */\n private computePoolId(poolKey: {\n currency0: Address;\n currency1: Address;\n fee: number;\n tickSpacing: number;\n hooks: Address;\n }): string {\n // V4 pools are identified by the hash of their PoolKey\n const encoded = encodeAbiParameters(\n [\n { type: 'address' },\n { type: 'address' },\n { type: 'uint24' },\n { type: 'int24' },\n { type: 'address' },\n ],\n [\n poolKey.currency0,\n poolKey.currency1,\n poolKey.fee,\n poolKey.tickSpacing,\n poolKey.hooks,\n ],\n );\n return keccak256(encoded);\n }\n\n /**\n * Read hook state with backward-compatible decoding.\n * Falls back to legacy state() ABI if the latest ABI fails to decode.\n */\n private async readHookState(): Promise<any> {\n const result: any = await this.rpc.readContract({\n address: this.hookAddress,\n abi: dopplerHookAbi,\n functionName: 'state',\n });\n if (Array.isArray(result)) {\n const [\n lastEpoch,\n tickAccumulator,\n totalTokensSold,\n totalProceeds,\n totalTokensSoldLastEpoch,\n feesAccrued,\n ] = result as any[];\n return {\n lastEpoch,\n tickAccumulator,\n totalTokensSold,\n totalProceeds,\n totalTokensSoldLastEpoch,\n feesAccrued,\n };\n }\n return result;\n }\n\n private normalizePoolKey(value: any): {\n currency0: Address;\n currency1: Address;\n fee: number;\n tickSpacing: number;\n hooks: Address;\n } {\n if (Array.isArray(value)) {\n const [currency0, currency1, fee, tickSpacing, hooks] = value as [\n Address,\n Address,\n number,\n number,\n Address,\n ];\n return { currency0, currency1, fee, tickSpacing, hooks };\n }\n return value as any;\n }\n}\n"]}
|
|
@@ -4,7 +4,7 @@ var chunkUPVKABAV_js = require('./chunk-UPVKABAV.js');
|
|
|
4
4
|
var chunk6H6X3VTZ_js = require('./chunk-6H6X3VTZ.js');
|
|
5
5
|
var chunk4VWQNNNW_js = require('./chunk-4VWQNNNW.js');
|
|
6
6
|
var chunk6BQY5EPB_js = require('./chunk-6BQY5EPB.js');
|
|
7
|
-
var
|
|
7
|
+
var chunk5VV7STYK_js = require('./chunk-5VV7STYK.js');
|
|
8
8
|
var chunk3MVW6UIW_js = require('./chunk-3MVW6UIW.js');
|
|
9
9
|
var chunkOF7BIKXV_js = require('./chunk-OF7BIKXV.js');
|
|
10
10
|
var chunk2ZM4JVFC_js = require('./chunk-2ZM4JVFC.js');
|
|
@@ -32,7 +32,7 @@ var DopplerFactory = class {
|
|
|
32
32
|
}
|
|
33
33
|
async encodeCreateStaticAuctionParams(params) {
|
|
34
34
|
this.validateStaticAuctionParams(params);
|
|
35
|
-
const addresses =
|
|
35
|
+
const addresses = chunk5VV7STYK_js.getAddresses(this.chainId);
|
|
36
36
|
const hasBeneficiaries = params.pool.beneficiaries && params.pool.beneficiaries.length > 0;
|
|
37
37
|
let poolInitializerData;
|
|
38
38
|
if (hasBeneficiaries) {
|
|
@@ -253,7 +253,7 @@ var DopplerFactory = class {
|
|
|
253
253
|
*/
|
|
254
254
|
async simulateCreateStaticAuction(params) {
|
|
255
255
|
const createParams = await this.encodeCreateStaticAuctionParams(params);
|
|
256
|
-
const addresses =
|
|
256
|
+
const addresses = chunk5VV7STYK_js.getAddresses(this.chainId);
|
|
257
257
|
const airlockAddress = params.modules?.airlock ?? addresses.airlock;
|
|
258
258
|
const { request, result } = await this.publicClient.simulateContract({
|
|
259
259
|
address: airlockAddress,
|
|
@@ -287,7 +287,7 @@ var DopplerFactory = class {
|
|
|
287
287
|
*/
|
|
288
288
|
async createStaticAuction(params, options) {
|
|
289
289
|
const createParams = options?._createParams ?? (await this.simulateCreateStaticAuction(params)).createParams;
|
|
290
|
-
const addresses =
|
|
290
|
+
const addresses = chunk5VV7STYK_js.getAddresses(this.chainId);
|
|
291
291
|
if (!this.walletClient) {
|
|
292
292
|
throw new Error("Wallet client required for write operations");
|
|
293
293
|
}
|
|
@@ -450,7 +450,7 @@ var DopplerFactory = class {
|
|
|
450
450
|
}
|
|
451
451
|
async encodeCreateDynamicAuctionParams(params) {
|
|
452
452
|
this.validateDynamicAuctionParams(params);
|
|
453
|
-
const addresses =
|
|
453
|
+
const addresses = chunk5VV7STYK_js.getAddresses(this.chainId);
|
|
454
454
|
const gamma = params.auction.gamma ?? chunkUPVKABAV_js.computeOptimalGamma(
|
|
455
455
|
params.auction.startTick,
|
|
456
456
|
params.auction.endTick,
|
|
@@ -634,7 +634,7 @@ var DopplerFactory = class {
|
|
|
634
634
|
* @returns The address of the created hook and token
|
|
635
635
|
*/
|
|
636
636
|
async createDynamicAuction(params, options) {
|
|
637
|
-
const addresses =
|
|
637
|
+
const addresses = chunk5VV7STYK_js.getAddresses(this.chainId);
|
|
638
638
|
let createParams;
|
|
639
639
|
if (options?._createParams) {
|
|
640
640
|
createParams = options._createParams;
|
|
@@ -708,7 +708,7 @@ var DopplerFactory = class {
|
|
|
708
708
|
*/
|
|
709
709
|
async simulateCreateDynamicAuction(params) {
|
|
710
710
|
const { createParams } = await this.encodeCreateDynamicAuctionParams(params);
|
|
711
|
-
const addresses =
|
|
711
|
+
const addresses = chunk5VV7STYK_js.getAddresses(this.chainId);
|
|
712
712
|
const airlockAddress = params.modules?.airlock ?? addresses.airlock;
|
|
713
713
|
const { request, result } = await this.publicClient.simulateContract({
|
|
714
714
|
address: airlockAddress,
|
|
@@ -988,7 +988,7 @@ var DopplerFactory = class {
|
|
|
988
988
|
params.pool.curves,
|
|
989
989
|
params.pool.tickSpacing
|
|
990
990
|
);
|
|
991
|
-
const addresses =
|
|
991
|
+
const addresses = chunk5VV7STYK_js.getAddresses(this.chainId);
|
|
992
992
|
const sortedBeneficiaries = (params.pool.beneficiaries ?? []).slice().sort(
|
|
993
993
|
(a, b) => {
|
|
994
994
|
const aAddr = a.beneficiary.toLowerCase();
|
|
@@ -1367,7 +1367,7 @@ var DopplerFactory = class {
|
|
|
1367
1367
|
return createParams;
|
|
1368
1368
|
}
|
|
1369
1369
|
async simulateCreateMulticurve(params) {
|
|
1370
|
-
const addresses =
|
|
1370
|
+
const addresses = chunk5VV7STYK_js.getAddresses(this.chainId);
|
|
1371
1371
|
const createParams = this.encodeCreateMulticurveParams(params);
|
|
1372
1372
|
const airlockAddress = params.modules?.airlock ?? addresses.airlock;
|
|
1373
1373
|
const { request, result } = await this.publicClient.simulateContract({
|
|
@@ -1398,7 +1398,7 @@ var DopplerFactory = class {
|
|
|
1398
1398
|
};
|
|
1399
1399
|
}
|
|
1400
1400
|
async createMulticurve(params, options) {
|
|
1401
|
-
const addresses =
|
|
1401
|
+
const addresses = chunk5VV7STYK_js.getAddresses(this.chainId);
|
|
1402
1402
|
if (!this.walletClient)
|
|
1403
1403
|
throw new Error("Wallet client required for write operations");
|
|
1404
1404
|
const createParams = options?._createParams ?? (await this.simulateCreateMulticurve(params)).createParams;
|
|
@@ -1743,14 +1743,14 @@ var DopplerFactory = class {
|
|
|
1743
1743
|
* Get the airlock contract address for the current chain
|
|
1744
1744
|
*/
|
|
1745
1745
|
getAirlockAddress() {
|
|
1746
|
-
const addresses =
|
|
1746
|
+
const addresses = chunk5VV7STYK_js.getAddresses(this.chainId);
|
|
1747
1747
|
return addresses.airlock;
|
|
1748
1748
|
}
|
|
1749
1749
|
/**
|
|
1750
1750
|
* Get the appropriate initializer address based on auction type
|
|
1751
1751
|
*/
|
|
1752
1752
|
getInitializerAddress(isStatic) {
|
|
1753
|
-
const addresses =
|
|
1753
|
+
const addresses = chunk5VV7STYK_js.getAddresses(this.chainId);
|
|
1754
1754
|
return isStatic ? addresses.v3Initializer : addresses.v4Initializer;
|
|
1755
1755
|
}
|
|
1756
1756
|
/**
|
|
@@ -1758,7 +1758,7 @@ var DopplerFactory = class {
|
|
|
1758
1758
|
* Used to perform atomic create + swap ("bundle") flows for static auctions
|
|
1759
1759
|
*/
|
|
1760
1760
|
getBundlerAddress() {
|
|
1761
|
-
const addresses =
|
|
1761
|
+
const addresses = chunk5VV7STYK_js.getAddresses(this.chainId);
|
|
1762
1762
|
const addr = addresses.bundler;
|
|
1763
1763
|
if (!addr || addr === viem.zeroAddress) {
|
|
1764
1764
|
throw new Error("Bundler address not configured for this chain");
|
|
@@ -1770,7 +1770,7 @@ var DopplerFactory = class {
|
|
|
1770
1770
|
* Allows override via ModuleAddressOverrides when provided in params.
|
|
1771
1771
|
*/
|
|
1772
1772
|
getMigratorAddress(config, overrides) {
|
|
1773
|
-
const addresses =
|
|
1773
|
+
const addresses = chunk5VV7STYK_js.getAddresses(this.chainId);
|
|
1774
1774
|
switch (config.type) {
|
|
1775
1775
|
case "uniswapV2":
|
|
1776
1776
|
return overrides?.v2Migrator ?? addresses.v2Migrator;
|
|
@@ -2341,7 +2341,7 @@ var DopplerFactory = class {
|
|
|
2341
2341
|
* Compute the V4 poolId for a multicurve pool by reading the hook address from the initializer
|
|
2342
2342
|
*/
|
|
2343
2343
|
async computeMulticurvePoolId(params, tokenAddress) {
|
|
2344
|
-
const addresses =
|
|
2344
|
+
const addresses = chunk5VV7STYK_js.getAddresses(this.chainId);
|
|
2345
2345
|
const initializerMode = this.resolveMulticurveInitializerMode(params);
|
|
2346
2346
|
let hookAddress;
|
|
2347
2347
|
if (initializerMode.type === "rehype") {
|
|
@@ -2403,5 +2403,5 @@ var DopplerFactory = class {
|
|
|
2403
2403
|
var MULTICURVE_BUNDLER_SELECTORS = ["0xe2e9faa1", "0x07087b06"];
|
|
2404
2404
|
|
|
2405
2405
|
exports.DopplerFactory = DopplerFactory;
|
|
2406
|
-
//# sourceMappingURL=chunk-
|
|
2407
|
-
//# sourceMappingURL=chunk-
|
|
2406
|
+
//# sourceMappingURL=chunk-QQEOKYEX.js.map
|
|
2407
|
+
//# sourceMappingURL=chunk-QQEOKYEX.js.map
|