{"version":3,"file":"uniswap-quoter-BAKtkoFM.mjs","names":[],"sources":["../../../node_modules/.pnpm/@clawnch+clawncher-sdk@0.3.4_@types+node@25.5.2_hardhat@2.28.6_typescript@6.0.2__typesc_a082d605d8b8771f03593b43bf11d8ac/node_modules/@clawnch/clawncher-sdk/dist/errors.js","../../../node_modules/.pnpm/@clawnch+clawncher-sdk@0.3.4_@types+node@25.5.2_hardhat@2.28.6_typescript@6.0.2__typesc_a082d605d8b8771f03593b43bf11d8ac/node_modules/@clawnch/clawncher-sdk/dist/addresses.js","../../../node_modules/.pnpm/@clawnch+clawncher-sdk@0.3.4_@types+node@25.5.2_hardhat@2.28.6_typescript@6.0.2__typesc_a082d605d8b8771f03593b43bf11d8ac/node_modules/@clawnch/clawncher-sdk/dist/abis.js","../../../node_modules/.pnpm/@clawnch+clawncher-sdk@0.3.4_@types+node@25.5.2_hardhat@2.28.6_typescript@6.0.2__typesc_a082d605d8b8771f03593b43bf11d8ac/node_modules/@clawnch/clawncher-sdk/dist/reader.js","../../../node_modules/.pnpm/@clawnch+clawncher-sdk@0.3.4_@types+node@25.5.2_hardhat@2.28.6_typescript@6.0.2__typesc_a082d605d8b8771f03593b43bf11d8ac/node_modules/@clawnch/clawncher-sdk/dist/uniswap-addresses.js","../../../node_modules/.pnpm/@clawnch+clawncher-sdk@0.3.4_@types+node@25.5.2_hardhat@2.28.6_typescript@6.0.2__typesc_a082d605d8b8771f03593b43bf11d8ac/node_modules/@clawnch/clawncher-sdk/dist/uniswap-abis.js","../../../node_modules/.pnpm/@clawnch+clawncher-sdk@0.3.4_@types+node@25.5.2_hardhat@2.28.6_typescript@6.0.2__typesc_a082d605d8b8771f03593b43bf11d8ac/node_modules/@clawnch/clawncher-sdk/dist/uniswap-chains.js","../../../node_modules/.pnpm/@clawnch+clawncher-sdk@0.3.4_@types+node@25.5.2_hardhat@2.28.6_typescript@6.0.2__typesc_a082d605d8b8771f03593b43bf11d8ac/node_modules/@clawnch/clawncher-sdk/dist/uniswap-quoter.js"],"sourcesContent":["/**\n * Clawncher SDK - Structured Error Codes\n *\n * Provides machine-readable error codes for programmatic error handling.\n * All SDK errors use ClawnchDeployError with a specific ClawnchErrorCode,\n * making it easy to handle different failure modes in automation.\n */\n/**\n * Error codes for all SDK operations\n */\nexport var ClawnchErrorCode;\n(function (ClawnchErrorCode) {\n    // Validation errors\n    ClawnchErrorCode[\"INVALID_BPS\"] = \"INVALID_BPS\";\n    ClawnchErrorCode[\"INVALID_NAME\"] = \"INVALID_NAME\";\n    ClawnchErrorCode[\"INVALID_SYMBOL\"] = \"INVALID_SYMBOL\";\n    ClawnchErrorCode[\"INVALID_ADDRESS\"] = \"INVALID_ADDRESS\";\n    // Configuration errors\n    ClawnchErrorCode[\"WALLET_NOT_CONFIGURED\"] = \"WALLET_NOT_CONFIGURED\";\n    ClawnchErrorCode[\"PUBLIC_CLIENT_NOT_CONFIGURED\"] = \"PUBLIC_CLIENT_NOT_CONFIGURED\";\n    // Deployment errors\n    ClawnchErrorCode[\"DEPLOY_FAILED\"] = \"DEPLOY_FAILED\";\n    ClawnchErrorCode[\"TX_REVERTED\"] = \"TX_REVERTED\";\n    ClawnchErrorCode[\"INSUFFICIENT_FUNDS\"] = \"INSUFFICIENT_FUNDS\";\n    // Claiming errors\n    ClawnchErrorCode[\"CLAIM_FAILED\"] = \"CLAIM_FAILED\";\n    ClawnchErrorCode[\"NO_FEES_AVAILABLE\"] = \"NO_FEES_AVAILABLE\";\n    // Feature not available\n    ClawnchErrorCode[\"FEATURE_NOT_AVAILABLE\"] = \"FEATURE_NOT_AVAILABLE\";\n    // Chain errors\n    ClawnchErrorCode[\"INVALID_CHAIN\"] = \"INVALID_CHAIN\";\n    // Network errors\n    ClawnchErrorCode[\"RPC_ERROR\"] = \"RPC_ERROR\";\n    ClawnchErrorCode[\"TIMEOUT\"] = \"TIMEOUT\";\n    // Herd integration errors\n    ClawnchErrorCode[\"HERD_UNAVAILABLE\"] = \"HERD_UNAVAILABLE\";\n})(ClawnchErrorCode || (ClawnchErrorCode = {}));\n/**\n * Structured error class for Clawncher SDK operations\n *\n * @example\n * ```typescript\n * try {\n *   const result = await deployer.deploy(options);\n * } catch (err) {\n *   if (err instanceof ClawnchDeployError) {\n *     switch (err.code) {\n *       case ClawnchErrorCode.WALLET_NOT_CONFIGURED:\n *         console.log('Please configure a wallet');\n *         break;\n *       case ClawnchErrorCode.INVALID_BPS:\n *         console.log('Fix your reward BPS:', err.message);\n *         break;\n *       case ClawnchErrorCode.DEPLOY_FAILED:\n *         console.log('Deployment failed:', err.message);\n *         if (err.cause) console.log('Caused by:', err.cause);\n *         break;\n *     }\n *   }\n * }\n * ```\n */\nexport class ClawnchDeployError extends Error {\n    code;\n    cause;\n    name = 'ClawnchDeployError';\n    constructor(code, message, cause) {\n        super(message);\n        this.code = code;\n        this.cause = cause;\n    }\n}\n/**\n * Type guard to check if an error is a ClawnchDeployError\n */\nexport function isClawnchError(err) {\n    return err instanceof ClawnchDeployError;\n}\n// =========================================================================\n// Retry Utility\n// =========================================================================\n/**\n * Retry an async operation with exponential backoff.\n *\n * Only retries on transient errors (network timeouts, 5xx, RPC errors).\n * Validation errors, 4xx, and feature-not-available are never retried.\n *\n * @param fn - Async function to retry\n * @param maxRetries - Maximum number of retries (default: 2, so 3 total attempts)\n * @param baseDelayMs - Base delay in ms between retries (default: 1000)\n * @returns Result of the function\n */\nexport async function withRetry(fn, maxRetries = 2, baseDelayMs = 1000) {\n    let lastError;\n    for (let attempt = 0; attempt <= maxRetries; attempt++) {\n        try {\n            return await fn();\n        }\n        catch (err) {\n            lastError = err;\n            // Don't retry on non-transient errors\n            if (err instanceof ClawnchDeployError) {\n                const nonRetryable = [\n                    ClawnchErrorCode.INVALID_BPS,\n                    ClawnchErrorCode.INVALID_NAME,\n                    ClawnchErrorCode.INVALID_SYMBOL,\n                    ClawnchErrorCode.INVALID_ADDRESS,\n                    ClawnchErrorCode.WALLET_NOT_CONFIGURED,\n                    ClawnchErrorCode.PUBLIC_CLIENT_NOT_CONFIGURED,\n                    ClawnchErrorCode.FEATURE_NOT_AVAILABLE,\n                    ClawnchErrorCode.INVALID_CHAIN,\n                    ClawnchErrorCode.INSUFFICIENT_FUNDS,\n                ];\n                if (nonRetryable.includes(err.code))\n                    throw err;\n            }\n            // Last attempt — don't sleep, just throw\n            if (attempt === maxRetries)\n                break;\n            // Exponential backoff: 1s, 2s, 4s, ...\n            const delay = baseDelayMs * Math.pow(2, attempt);\n            await new Promise(resolve => setTimeout(resolve, delay));\n        }\n    }\n    throw lastError;\n}\n//# sourceMappingURL=errors.js.map","/**\n * Clawncher Contract Addresses (v3 - Clanker-backed)\n *\n * In v3, Clawncher deploys through Clanker's approved Uniswap V4 infrastructure.\n * These addresses point to Clanker's contracts on Base networks.\n *\n * Our own v2 contracts are preserved in packages/sdk-direct for when our\n * Uniswap V4 hook is approved.\n */\n/**\n * Base Sepolia (testnet) addresses - Clanker's Sepolia deployment\n */\nexport const SEPOLIA_ADDRESSES = {\n    clawnch: {\n        factory: '0xE85A59c628F7d27878ACeB4bf3b35733630083a9',\n        hook: '0x11b51DBC2f7F683b81CeDa83DC0078D57bA328cc',\n        locker: '0x824bB048a5EC6e06a09aEd115E9eEA4618DC2c8f',\n        feeLocker: '0x42A95190B4088C88Dd904d930c79deC1158bF09D',\n        mevModule: '0x261fE99C4D0D41EE8d0e594D11aec740E8354ab0',\n        vault: '0xcC80d1226F899a78fC2E459a1500A13C373CE0A5',\n        airdropV2: '0x5c68F1560a5913c176Fc5238038098970B567B19',\n        devBuy: '0x691f97752E91feAcD7933F32a1FEdCeDae7bB59c',\n        vestedDevBuy: '0x0000000000000000000000000000000000000000', // Not available via Clanker\n        poolExtensionAllowlist: '0x0000000000000000000000000000000000000000',\n    },\n    infrastructure: {\n        poolManager: '0x05E73354cFDd6745C338b50BcFDfA3Aa6fA03408',\n        positionManager: '0x4B2C77d209D3405F41a037Ec6c77F7F5b8e2ca80',\n        permit2: '0x000000000022D473030F116dDEE9F6B43aC78BA3',\n        universalRouter: '0x492E6456D9528771018DeB9E87ef7750EF184104',\n        weth: '0x4200000000000000000000000000000000000006',\n    },\n};\n/**\n * Base Mainnet addresses - Clanker's v4 deployment\n */\nexport const MAINNET_ADDRESSES = {\n    clawnch: {\n        factory: '0xE85A59c628F7d27878ACeB4bf3b35733630083a9',\n        hook: '0xb429d62f8f3bFFb98CdB9569533eA23bF0Ba28CC',\n        locker: '0x63D2DfEA64b3433F4071A98665bcD7Ca14d93496',\n        feeLocker: '0xF3622742b1E446D92e45E22923Ef11C2fcD55D68',\n        mevModule: '0xebB25BB797D82CB78E1bc70406b13233c0854413',\n        vault: '0x8E845EAd15737bF71904A30BdDD3aEE76d6ADF6C',\n        airdropV2: '0xf652B3610D75D81871bf96DB50825d9af28391E0',\n        devBuy: '0x1331f0788F9c08C8F38D52c7a1752250A9dE00be',\n        vestedDevBuy: '0x0000000000000000000000000000000000000000', // Not available via Clanker\n        poolExtensionAllowlist: '0x0000000000000000000000000000000000000000',\n    },\n    infrastructure: {\n        poolManager: '0x498581fF718922c3f8e6A244956aF099B2652b2b',\n        positionManager: '0x7C5f5A4bBd8fD63184577525326123B519429bDc',\n        permit2: '0x000000000022D473030F116dDEE9F6B43aC78BA3',\n        universalRouter: '0x6fF5693b99212Da76ad316178A184AB56D299b43',\n        weth: '0x4200000000000000000000000000000000000006',\n    },\n};\nexport function getAddresses(network) {\n    switch (network) {\n        case 'mainnet':\n            return MAINNET_ADDRESSES;\n        case 'sepolia':\n            return SEPOLIA_ADDRESSES;\n        default:\n            throw new Error(`Unknown network: ${network}`);\n    }\n}\n/**\n * Check if mainnet is ready for deployment\n */\nexport function isMainnetReady() {\n    return MAINNET_ADDRESSES.clawnch.factory !== '0x0000000000000000000000000000000000000000';\n}\n/**\n * Get the chain ID for a network\n */\nexport function getChainId(network) {\n    return network === 'mainnet' ? 8453 : 84532;\n}\n//# sourceMappingURL=addresses.js.map","/**\n * Clawncher Contract ABIs\n *\n * Minimal ABIs for SDK functionality. UI builders may need full ABIs\n * which can be generated from contract compilation.\n */\nexport const ClawnchFactoryABI = [\n    {\n        inputs: [\n            {\n                components: [\n                    {\n                        components: [\n                            { internalType: 'address', name: 'tokenAdmin', type: 'address' },\n                            { internalType: 'string', name: 'name', type: 'string' },\n                            { internalType: 'string', name: 'symbol', type: 'string' },\n                            { internalType: 'bytes32', name: 'salt', type: 'bytes32' },\n                            { internalType: 'string', name: 'image', type: 'string' },\n                            { internalType: 'string', name: 'metadata', type: 'string' },\n                            { internalType: 'string', name: 'context', type: 'string' },\n                            { internalType: 'uint256', name: 'originatingChainId', type: 'uint256' },\n                        ],\n                        internalType: 'struct IClawnch.TokenConfig',\n                        name: 'tokenConfig',\n                        type: 'tuple',\n                    },\n                    {\n                        components: [\n                            { internalType: 'address', name: 'hook', type: 'address' },\n                            { internalType: 'address', name: 'pairedToken', type: 'address' },\n                            { internalType: 'int24', name: 'tickIfToken0IsClawnch', type: 'int24' },\n                            { internalType: 'int24', name: 'tickSpacing', type: 'int24' },\n                            { internalType: 'bytes', name: 'poolData', type: 'bytes' },\n                        ],\n                        internalType: 'struct IClawnch.PoolConfig',\n                        name: 'poolConfig',\n                        type: 'tuple',\n                    },\n                    {\n                        components: [\n                            { internalType: 'address', name: 'locker', type: 'address' },\n                            { internalType: 'address[]', name: 'rewardAdmins', type: 'address[]' },\n                            { internalType: 'address[]', name: 'rewardRecipients', type: 'address[]' },\n                            { internalType: 'uint16[]', name: 'rewardBps', type: 'uint16[]' },\n                            { internalType: 'int24[]', name: 'tickLower', type: 'int24[]' },\n                            { internalType: 'int24[]', name: 'tickUpper', type: 'int24[]' },\n                            { internalType: 'uint16[]', name: 'positionBps', type: 'uint16[]' },\n                            { internalType: 'bytes', name: 'lockerData', type: 'bytes' },\n                        ],\n                        internalType: 'struct IClawnch.LockerConfig',\n                        name: 'lockerConfig',\n                        type: 'tuple',\n                    },\n                    {\n                        components: [\n                            { internalType: 'address', name: 'mevModule', type: 'address' },\n                            { internalType: 'bytes', name: 'mevModuleData', type: 'bytes' },\n                        ],\n                        internalType: 'struct IClawnch.MevModuleConfig',\n                        name: 'mevModuleConfig',\n                        type: 'tuple',\n                    },\n                    {\n                        components: [\n                            { internalType: 'address', name: 'extension', type: 'address' },\n                            { internalType: 'uint256', name: 'msgValue', type: 'uint256' },\n                            { internalType: 'uint16', name: 'extensionBps', type: 'uint16' },\n                            { internalType: 'bytes', name: 'extensionData', type: 'bytes' },\n                        ],\n                        internalType: 'struct IClawnch.ExtensionConfig[]',\n                        name: 'extensionConfigs',\n                        type: 'tuple[]',\n                    },\n                ],\n                internalType: 'struct IClawnch.DeploymentConfig',\n                name: 'deploymentConfig',\n                type: 'tuple',\n            },\n        ],\n        name: 'deployToken',\n        outputs: [{ internalType: 'address', name: 'tokenAddress', type: 'address' }],\n        stateMutability: 'payable',\n        type: 'function',\n    },\n    {\n        inputs: [{ internalType: 'address', name: 'token', type: 'address' }],\n        name: 'tokenDeploymentInfo',\n        outputs: [\n            {\n                components: [\n                    { internalType: 'address', name: 'token', type: 'address' },\n                    { internalType: 'address', name: 'hook', type: 'address' },\n                    { internalType: 'address', name: 'locker', type: 'address' },\n                    { internalType: 'address[]', name: 'extensions', type: 'address[]' },\n                ],\n                internalType: 'struct IClawnch.DeploymentInfo',\n                name: '',\n                type: 'tuple',\n            },\n        ],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [],\n        name: 'deprecated',\n        outputs: [{ internalType: 'bool', name: '', type: 'bool' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        anonymous: false,\n        inputs: [\n            { indexed: false, internalType: 'address', name: 'msgSender', type: 'address' },\n            { indexed: true, internalType: 'address', name: 'tokenAddress', type: 'address' },\n            { indexed: true, internalType: 'address', name: 'tokenAdmin', type: 'address' },\n            { indexed: false, internalType: 'string', name: 'tokenImage', type: 'string' },\n            { indexed: false, internalType: 'string', name: 'tokenName', type: 'string' },\n            { indexed: false, internalType: 'string', name: 'tokenSymbol', type: 'string' },\n            { indexed: false, internalType: 'string', name: 'tokenMetadata', type: 'string' },\n            { indexed: false, internalType: 'string', name: 'tokenContext', type: 'string' },\n            { indexed: false, internalType: 'int24', name: 'startingTick', type: 'int24' },\n            { indexed: false, internalType: 'address', name: 'poolHook', type: 'address' },\n            { indexed: false, internalType: 'bytes32', name: 'poolId', type: 'bytes32' },\n            { indexed: false, internalType: 'address', name: 'pairedToken', type: 'address' },\n            { indexed: false, internalType: 'address', name: 'locker', type: 'address' },\n            { indexed: false, internalType: 'address', name: 'mevModule', type: 'address' },\n            { indexed: false, internalType: 'uint256', name: 'extensionsSupply', type: 'uint256' },\n            { indexed: false, internalType: 'address[]', name: 'extensions', type: 'address[]' },\n        ],\n        name: 'TokenCreated',\n        type: 'event',\n    },\n];\nexport const ClawnchFeeLockerABI = [\n    {\n        inputs: [\n            { internalType: 'address', name: 'feeOwner', type: 'address' },\n            { internalType: 'address', name: 'token', type: 'address' },\n        ],\n        name: 'availableFees',\n        outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [\n            { internalType: 'address', name: 'feeOwner', type: 'address' },\n            { internalType: 'address', name: 'token', type: 'address' },\n        ],\n        name: 'claim',\n        outputs: [],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n];\nexport const ClawnchLpLockerABI = [\n    {\n        inputs: [{ internalType: 'address', name: 'token', type: 'address' }],\n        name: 'collectRewards',\n        outputs: [],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    {\n        inputs: [{ internalType: 'address', name: 'token', type: 'address' }],\n        name: 'tokenRewards',\n        outputs: [\n            {\n                components: [\n                    { internalType: 'address', name: 'token', type: 'address' },\n                    {\n                        components: [\n                            { internalType: 'address', name: 'currency0', type: 'address' },\n                            { internalType: 'address', name: 'currency1', type: 'address' },\n                            { internalType: 'uint24', name: 'fee', type: 'uint24' },\n                            { internalType: 'int24', name: 'tickSpacing', type: 'int24' },\n                            { internalType: 'address', name: 'hooks', type: 'address' },\n                        ],\n                        internalType: 'struct PoolKey',\n                        name: 'poolKey',\n                        type: 'tuple',\n                    },\n                    { internalType: 'uint256', name: 'positionId', type: 'uint256' },\n                    { internalType: 'uint256', name: 'numPositions', type: 'uint256' },\n                    { internalType: 'uint16[]', name: 'rewardBps', type: 'uint16[]' },\n                    { internalType: 'address[]', name: 'rewardAdmins', type: 'address[]' },\n                    { internalType: 'address[]', name: 'rewardRecipients', type: 'address[]' },\n                ],\n                internalType: 'struct IClawnchLpLocker.TokenRewardInfo',\n                name: '',\n                type: 'tuple',\n            },\n        ],\n        stateMutability: 'view',\n        type: 'function',\n    },\n];\nexport const ERC20ABI = [\n    {\n        inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n        name: 'balanceOf',\n        outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [],\n        name: 'totalSupply',\n        outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [],\n        name: 'name',\n        outputs: [{ internalType: 'string', name: '', type: 'string' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [],\n        name: 'symbol',\n        outputs: [{ internalType: 'string', name: '', type: 'string' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [],\n        name: 'decimals',\n        outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n];\n/**\n * ClawnchVault ABI - Read vault allocation data\n */\nexport const ClawnchVaultABI = [\n    {\n        inputs: [{ internalType: 'address', name: 'token', type: 'address' }],\n        name: 'allocation',\n        outputs: [\n            { internalType: 'address', name: 'token', type: 'address' },\n            { internalType: 'uint256', name: 'amountTotal', type: 'uint256' },\n            { internalType: 'uint256', name: 'amountClaimed', type: 'uint256' },\n            { internalType: 'uint256', name: 'lockupEndTime', type: 'uint256' },\n            { internalType: 'uint256', name: 'vestingEndTime', type: 'uint256' },\n            { internalType: 'address', name: 'admin', type: 'address' },\n        ],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [{ internalType: 'address', name: 'token', type: 'address' }],\n        name: 'amountAvailableToClaim',\n        outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [{ internalType: 'address', name: 'token', type: 'address' }],\n        name: 'claim',\n        outputs: [],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    {\n        inputs: [\n            { internalType: 'address', name: 'token', type: 'address' },\n            { internalType: 'address', name: 'newAdmin', type: 'address' },\n        ],\n        name: 'editAllocationAdmin',\n        outputs: [],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    {\n        anonymous: false,\n        inputs: [\n            { indexed: true, internalType: 'address', name: 'token', type: 'address' },\n            { indexed: false, internalType: 'address', name: 'admin', type: 'address' },\n            { indexed: false, internalType: 'uint256', name: 'supply', type: 'uint256' },\n            { indexed: false, internalType: 'uint256', name: 'lockupDuration', type: 'uint256' },\n            { indexed: false, internalType: 'uint256', name: 'vestingDuration', type: 'uint256' },\n        ],\n        name: 'AllocationCreated',\n        type: 'event',\n    },\n    {\n        anonymous: false,\n        inputs: [\n            { indexed: true, internalType: 'address', name: 'token', type: 'address' },\n            { indexed: false, internalType: 'uint256', name: 'amountClaimed', type: 'uint256' },\n            { indexed: false, internalType: 'uint256', name: 'amountRemaining', type: 'uint256' },\n        ],\n        name: 'AllocationClaimed',\n        type: 'event',\n    },\n];\n/**\n * ClawncherVestedDevBuy ABI - Read vested dev buy allocation data\n */\nexport const ClawncherVestedDevBuyABI = [\n    {\n        inputs: [{ internalType: 'address', name: 'token', type: 'address' }],\n        name: 'allocation',\n        outputs: [\n            { internalType: 'address', name: 'token', type: 'address' },\n            { internalType: 'uint256', name: 'amountTotal', type: 'uint256' },\n            { internalType: 'uint256', name: 'amountClaimed', type: 'uint256' },\n            { internalType: 'uint256', name: 'lockupEndTime', type: 'uint256' },\n            { internalType: 'uint256', name: 'vestingEndTime', type: 'uint256' },\n            { internalType: 'address', name: 'admin', type: 'address' },\n        ],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [{ internalType: 'address', name: 'token', type: 'address' }],\n        name: 'amountAvailableToClaim',\n        outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [{ internalType: 'address', name: 'token', type: 'address' }],\n        name: 'claim',\n        outputs: [],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    {\n        inputs: [\n            { internalType: 'address', name: 'token', type: 'address' },\n            { internalType: 'address', name: 'newAdmin', type: 'address' },\n        ],\n        name: 'editAllocationAdmin',\n        outputs: [],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    {\n        anonymous: false,\n        inputs: [\n            { indexed: true, internalType: 'address', name: 'token', type: 'address' },\n            { indexed: true, internalType: 'address', name: 'recipient', type: 'address' },\n            { indexed: false, internalType: 'uint256', name: 'ethAmount', type: 'uint256' },\n            { indexed: false, internalType: 'uint256', name: 'tokenAmount', type: 'uint256' },\n            { indexed: false, internalType: 'uint256', name: 'lockupDuration', type: 'uint256' },\n            { indexed: false, internalType: 'uint256', name: 'vestingDuration', type: 'uint256' },\n        ],\n        name: 'VestedDevBuy',\n        type: 'event',\n    },\n    {\n        anonymous: false,\n        inputs: [\n            { indexed: true, internalType: 'address', name: 'token', type: 'address' },\n            { indexed: false, internalType: 'uint256', name: 'amountClaimed', type: 'uint256' },\n            { indexed: false, internalType: 'uint256', name: 'amountRemaining', type: 'uint256' },\n        ],\n        name: 'AllocationClaimed',\n        type: 'event',\n    },\n];\n/**\n * ClawnchHookStaticFeeV2 ABI - Read fee configuration\n */\nexport const ClawnchHookABI = [\n    {\n        inputs: [{ internalType: 'bytes32', name: 'poolId', type: 'bytes32' }],\n        name: 'feeConfig',\n        outputs: [\n            { internalType: 'uint24', name: 'buyFee', type: 'uint24' },\n            { internalType: 'uint24', name: 'sellFee', type: 'uint24' },\n        ],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [],\n        name: 'protocolFee',\n        outputs: [{ internalType: 'uint24', name: '', type: 'uint24' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n];\n/**\n * ClawnchMevDescendingFees ABI - Read MEV protection config\n *\n * Contract function names:\n *   feeConfig(bytes32 poolId) - not mevConfig(address)\n *   getFee(bytes32 poolId) - not currentFee(address)\n *   poolStartTime(bytes32 poolId) - start time for decay calculation\n *\n * PoolId is bytes32 (Uniswap V4 pool identifier).\n * Decay end = poolStartTime + feeConfig.secondsToDecay\n */\nexport const ClawnchMevModuleABI = [\n    {\n        inputs: [{ internalType: 'PoolId', name: 'poolId', type: 'bytes32' }],\n        name: 'feeConfig',\n        outputs: [\n            { internalType: 'uint24', name: 'startingFee', type: 'uint24' },\n            { internalType: 'uint24', name: 'endingFee', type: 'uint24' },\n            { internalType: 'uint256', name: 'secondsToDecay', type: 'uint256' },\n        ],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [{ internalType: 'PoolId', name: 'poolId', type: 'bytes32' }],\n        name: 'poolStartTime',\n        outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [{ internalType: 'PoolId', name: 'poolId', type: 'bytes32' }],\n        name: 'getFee',\n        outputs: [{ internalType: 'uint24', name: '', type: 'uint24' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n];\n/**\n * ClawnchToken ABI - Read token-specific data (admin, metadata)\n *\n * Contract function names:\n *   admin() - not tokenAdmin()\n *   imageUrl() - not image()\n *   allData() - returns all metadata in one call\n */\nexport const ClawnchTokenABI = [\n    ...ERC20ABI,\n    {\n        inputs: [],\n        name: 'admin',\n        outputs: [{ internalType: 'address', name: '', type: 'address' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [],\n        name: 'originalAdmin',\n        outputs: [{ internalType: 'address', name: '', type: 'address' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [],\n        name: 'imageUrl',\n        outputs: [{ internalType: 'string', name: '', type: 'string' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [],\n        name: 'metadata',\n        outputs: [{ internalType: 'string', name: '', type: 'string' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [],\n        name: 'context',\n        outputs: [{ internalType: 'string', name: '', type: 'string' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [],\n        name: 'allData',\n        outputs: [\n            { internalType: 'address', name: 'originalAdmin', type: 'address' },\n            { internalType: 'address', name: 'admin', type: 'address' },\n            { internalType: 'string', name: 'image', type: 'string' },\n            { internalType: 'string', name: 'metadata', type: 'string' },\n            { internalType: 'string', name: 'context', type: 'string' },\n        ],\n        stateMutability: 'view',\n        type: 'function',\n    },\n];\n//# sourceMappingURL=abis.js.map","/**\n * ClawnchReader - Read on-chain token data from Clanker's contracts\n *\n * v3: Reads from Clanker's approved infrastructure (same ABI, different addresses).\n * Provides read-only access to token deployment info, vault allocations,\n * fee configurations, and reward info.\n *\n * Used by frontends to display token detail pages and admin functionality.\n */\nimport { formatUnits, } from 'viem';\nimport { base, baseSepolia } from 'viem/chains';\nimport { ClawnchFactoryABI, ClawnchFeeLockerABI, ClawnchLpLockerABI, ClawnchVaultABI, ClawncherVestedDevBuyABI, ClawnchMevModuleABI, ClawnchTokenABI, ERC20ABI, } from './abis.js';\nimport { getAddresses } from './addresses.js';\n/**\n * ClawnchReader - Read on-chain token data\n *\n * @example\n * ```typescript\n * import { ClawnchReader } from '@clawnch/clawncher-sdk';\n * import { createPublicClient, http } from 'viem';\n * import { baseSepolia } from 'viem/chains';\n *\n * const publicClient = createPublicClient({\n *   chain: baseSepolia,\n *   transport: http(),\n * });\n *\n * const reader = new ClawnchReader({\n *   publicClient,\n *   network: 'sepolia',\n * });\n *\n * // Get full token details\n * const details = await reader.getTokenDetails('0x...');\n *\n * // Get vault allocation\n * const vault = await reader.getVaultAllocation('0x...');\n *\n * // Get vested dev buy allocation\n * const vested = await reader.getVestedDevBuyAllocation('0x...');\n * ```\n */\nexport class ClawnchReader {\n    publicClient;\n    network;\n    constructor(config) {\n        this.publicClient = config.publicClient;\n        this.network = config.network;\n    }\n    /**\n     * Get contract addresses for configured network\n     */\n    getAddresses() {\n        return getAddresses(this.network);\n    }\n    /**\n     * Get the chain for the configured network\n     */\n    getChain() {\n        return this.network === 'mainnet' ? base : baseSepolia;\n    }\n    // =========================================================================\n    // Token Info\n    // =========================================================================\n    /**\n     * Get basic ERC20 token info\n     */\n    async getTokenInfo(token) {\n        const [name, symbol, decimals, totalSupply] = await Promise.all([\n            this.publicClient.readContract({\n                address: token,\n                abi: ERC20ABI,\n                functionName: 'name',\n            }),\n            this.publicClient.readContract({\n                address: token,\n                abi: ERC20ABI,\n                functionName: 'symbol',\n            }),\n            this.publicClient.readContract({\n                address: token,\n                abi: ERC20ABI,\n                functionName: 'decimals',\n            }),\n            this.publicClient.readContract({\n                address: token,\n                abi: ERC20ABI,\n                functionName: 'totalSupply',\n            }),\n        ]);\n        return { name, symbol, decimals, totalSupply };\n    }\n    /**\n     * Get Clawncher token metadata using allData() single call\n     *\n     * Returns originalAdmin, admin, imageUrl, metadata, context in one RPC call.\n     */\n    async getTokenMetadata(token) {\n        try {\n            // Use allData() for a single RPC call instead of 4 separate calls\n            const result = await this.publicClient.readContract({\n                address: token,\n                abi: ClawnchTokenABI,\n                functionName: 'allData',\n            });\n            const [originalAdmin, admin, image, metadata, context] = result;\n            return {\n                tokenAdmin: admin,\n                originalAdmin,\n                image,\n                metadata,\n                context,\n            };\n        }\n        catch {\n            // Fallback to individual calls if allData() is not available\n            const [admin, image, metadata, context] = await Promise.all([\n                this.publicClient.readContract({\n                    address: token,\n                    abi: ClawnchTokenABI,\n                    functionName: 'admin',\n                }),\n                this.publicClient.readContract({\n                    address: token,\n                    abi: ClawnchTokenABI,\n                    functionName: 'imageUrl',\n                }).catch(() => ''),\n                this.publicClient.readContract({\n                    address: token,\n                    abi: ClawnchTokenABI,\n                    functionName: 'metadata',\n                }).catch(() => ''),\n                this.publicClient.readContract({\n                    address: token,\n                    abi: ClawnchTokenABI,\n                    functionName: 'context',\n                }).catch(() => ''),\n            ]);\n            return {\n                tokenAdmin: admin,\n                originalAdmin: admin, // fallback: assume same\n                image: image,\n                metadata: metadata,\n                context: context,\n            };\n        }\n    }\n    /**\n     * Get token deployment info from factory\n     */\n    async getDeploymentInfo(token) {\n        const addresses = this.getAddresses();\n        try {\n            const info = await this.publicClient.readContract({\n                address: addresses.clawnch.factory,\n                abi: ClawnchFactoryABI,\n                functionName: 'tokenDeploymentInfo',\n                args: [token],\n            });\n            const result = info;\n            // If token is zero address, it's not a Clawncher token\n            if (result.token === '0x0000000000000000000000000000000000000000') {\n                return null;\n            }\n            return {\n                token: result.token,\n                hook: result.hook,\n                locker: result.locker,\n                extensions: result.extensions,\n            };\n        }\n        catch {\n            return null;\n        }\n    }\n    // =========================================================================\n    // Vault\n    // =========================================================================\n    /**\n     * Get vault allocation for a token\n     */\n    async getVaultAllocation(token) {\n        const addresses = this.getAddresses();\n        try {\n            const [allocation, amountAvailable] = await Promise.all([\n                this.publicClient.readContract({\n                    address: addresses.clawnch.vault,\n                    abi: ClawnchVaultABI,\n                    functionName: 'allocation',\n                    args: [token],\n                }),\n                this.publicClient.readContract({\n                    address: addresses.clawnch.vault,\n                    abi: ClawnchVaultABI,\n                    functionName: 'amountAvailableToClaim',\n                    args: [token],\n                }),\n            ]);\n            const [tokenAddr, amountTotal, amountClaimed, lockupEndTime, vestingEndTime, admin] = allocation;\n            // If lockupEndTime is 0, no allocation exists\n            if (lockupEndTime === 0n) {\n                return null;\n            }\n            const now = BigInt(Math.floor(Date.now() / 1000));\n            const isUnlocked = now >= lockupEndTime;\n            const isFullyVested = now >= vestingEndTime;\n            let percentVested = 0;\n            if (isFullyVested) {\n                percentVested = 100;\n            }\n            else if (isUnlocked && vestingEndTime > lockupEndTime) {\n                const elapsed = now - lockupEndTime;\n                const vestingDuration = vestingEndTime - lockupEndTime;\n                percentVested = Number((elapsed * 100n) / vestingDuration);\n            }\n            return {\n                token: tokenAddr,\n                amountTotal,\n                amountClaimed,\n                lockupEndTime,\n                vestingEndTime,\n                admin,\n                amountAvailable: amountAvailable,\n                isUnlocked,\n                isFullyVested,\n                percentVested,\n            };\n        }\n        catch {\n            return null;\n        }\n    }\n    // =========================================================================\n    // Vested Dev Buy\n    // =========================================================================\n    /**\n     * Get vested dev buy allocation for a token\n     */\n    async getVestedDevBuyAllocation(token) {\n        const addresses = this.getAddresses();\n        // Check if vestedDevBuy is deployed\n        if (addresses.clawnch.vestedDevBuy === '0x0000000000000000000000000000000000000000') {\n            return null;\n        }\n        try {\n            const [allocation, amountAvailable] = await Promise.all([\n                this.publicClient.readContract({\n                    address: addresses.clawnch.vestedDevBuy,\n                    abi: ClawncherVestedDevBuyABI,\n                    functionName: 'allocation',\n                    args: [token],\n                }),\n                this.publicClient.readContract({\n                    address: addresses.clawnch.vestedDevBuy,\n                    abi: ClawncherVestedDevBuyABI,\n                    functionName: 'amountAvailableToClaim',\n                    args: [token],\n                }),\n            ]);\n            const [tokenAddr, amountTotal, amountClaimed, lockupEndTime, vestingEndTime, admin] = allocation;\n            // If lockupEndTime is 0, no allocation exists\n            if (lockupEndTime === 0n) {\n                return null;\n            }\n            const now = BigInt(Math.floor(Date.now() / 1000));\n            const isUnlocked = now >= lockupEndTime;\n            const isFullyVested = now >= vestingEndTime;\n            let percentVested = 0;\n            if (isFullyVested) {\n                percentVested = 100;\n            }\n            else if (isUnlocked && vestingEndTime > lockupEndTime) {\n                const elapsed = now - lockupEndTime;\n                const vestingDuration = vestingEndTime - lockupEndTime;\n                percentVested = Number((elapsed * 100n) / vestingDuration);\n            }\n            return {\n                token: tokenAddr,\n                amountTotal,\n                amountClaimed,\n                lockupEndTime,\n                vestingEndTime,\n                admin,\n                amountAvailable: amountAvailable,\n                isUnlocked,\n                isFullyVested,\n                percentVested,\n            };\n        }\n        catch {\n            return null;\n        }\n    }\n    // =========================================================================\n    // Rewards\n    // =========================================================================\n    /**\n     * Get token reward info (recipients, positions) from LP locker\n     */\n    async getTokenRewards(token) {\n        const addresses = this.getAddresses();\n        try {\n            const rewards = await this.publicClient.readContract({\n                address: addresses.clawnch.locker,\n                abi: ClawnchLpLockerABI,\n                functionName: 'tokenRewards',\n                args: [token],\n            });\n            const result = rewards;\n            return {\n                token: result.token,\n                poolKey: result.poolKey,\n                positionId: result.positionId,\n                numPositions: result.numPositions,\n                rewardBps: result.rewardBps,\n                rewardAdmins: result.rewardAdmins,\n                rewardRecipients: result.rewardRecipients,\n            };\n        }\n        catch {\n            return null;\n        }\n    }\n    /**\n     * Get available fees for a wallet on a specific token\n     */\n    async getAvailableFees(wallet, token) {\n        const addresses = this.getAddresses();\n        try {\n            const fees = await this.publicClient.readContract({\n                address: addresses.clawnch.feeLocker,\n                abi: ClawnchFeeLockerABI,\n                functionName: 'availableFees',\n                args: [wallet, token],\n            });\n            return fees;\n        }\n        catch {\n            return 0n;\n        }\n    }\n    /**\n     * Get all available fees for a wallet across multiple tokens\n     */\n    async getWalletFees(wallet, tokens) {\n        const addresses = this.getAddresses();\n        const results = await Promise.all(tokens.map(async (token) => {\n            const [fees, symbol] = await Promise.all([\n                this.getAvailableFees(wallet, token),\n                this.publicClient.readContract({\n                    address: token,\n                    abi: ERC20ABI,\n                    functionName: 'symbol',\n                }).catch(() => 'UNKNOWN'),\n            ]);\n            return {\n                token,\n                symbol: symbol,\n                availableFees: fees,\n                formattedFees: formatUnits(fees, 18),\n            };\n        }));\n        // For WETH total, check available WETH fees\n        const wethFees = await this.getAvailableFees(wallet, addresses.infrastructure.weth);\n        return {\n            wallet,\n            tokens: results,\n            totalWeth: wethFees,\n            formattedTotalWeth: formatUnits(wethFees, 18),\n        };\n    }\n    // =========================================================================\n    // MEV Protection\n    // =========================================================================\n    /**\n     * Get MEV protection config for a pool by its poolId (bytes32)\n     *\n     * Use `getMevConfigForToken()` if you have a token address instead of poolId.\n     */\n    async getMevConfig(poolId) {\n        const addresses = this.getAddresses();\n        try {\n            const [config, startTime, currentFee] = await Promise.all([\n                this.publicClient.readContract({\n                    address: addresses.clawnch.mevModule,\n                    abi: ClawnchMevModuleABI,\n                    functionName: 'feeConfig',\n                    args: [poolId],\n                }),\n                this.publicClient.readContract({\n                    address: addresses.clawnch.mevModule,\n                    abi: ClawnchMevModuleABI,\n                    functionName: 'poolStartTime',\n                    args: [poolId],\n                }),\n                this.publicClient.readContract({\n                    address: addresses.clawnch.mevModule,\n                    abi: ClawnchMevModuleABI,\n                    functionName: 'getFee',\n                    args: [poolId],\n                }),\n            ]);\n            const [startingFee, endingFee, secondsToDecay] = config;\n            const poolStartTime = startTime;\n            // If secondsToDecay is 0, MEV config doesn't exist for this pool\n            if (secondsToDecay === 0n) {\n                return null;\n            }\n            const decayEndTime = poolStartTime + secondsToDecay;\n            const now = BigInt(Math.floor(Date.now() / 1000));\n            return {\n                startingFee,\n                endingFee,\n                secondsToDecay,\n                poolStartTime,\n                decayEndTime,\n                currentFee: currentFee,\n                isDecayComplete: now >= decayEndTime,\n            };\n        }\n        catch {\n            return null;\n        }\n    }\n    /**\n     * Get MEV protection config for a token (resolves poolId via LP locker first)\n     */\n    async getMevConfigForToken(token) {\n        // Get the poolId from token rewards (which has the poolKey)\n        const rewards = await this.getTokenRewards(token);\n        if (!rewards)\n            return null;\n        // Compute poolId from poolKey: keccak256(abi.encode(currency0, currency1, fee, tickSpacing, hooks))\n        const { encodeAbiParameters, parseAbiParameters, keccak256 } = await import('viem');\n        const poolId = keccak256(encodeAbiParameters(parseAbiParameters('address, address, uint24, int24, address'), [\n            rewards.poolKey.currency0,\n            rewards.poolKey.currency1,\n            rewards.poolKey.fee,\n            rewards.poolKey.tickSpacing,\n            rewards.poolKey.hooks,\n        ]));\n        return this.getMevConfig(poolId);\n    }\n    // =========================================================================\n    // Full Token Details\n    // =========================================================================\n    /**\n     * Get complete token details for UI display\n     *\n     * Combines basic token info, deployment info, vault, vested dev buy,\n     * reward recipients, and MEV config into a single response.\n     */\n    async getTokenDetails(token) {\n        // First check if this is a Clawncher token\n        const deployment = await this.getDeploymentInfo(token);\n        if (!deployment) {\n            return null;\n        }\n        // Fetch all data in parallel (except MEV which needs poolId from rewards)\n        const [tokenInfo, tokenMetadata, rewards, vault, vestedDevBuy,] = await Promise.all([\n            this.getTokenInfo(token),\n            this.getTokenMetadata(token),\n            this.getTokenRewards(token),\n            this.getVaultAllocation(token),\n            this.getVestedDevBuyAllocation(token),\n        ]);\n        // MEV config needs poolId from rewards, so fetch it after\n        const mev = await this.getMevConfigForToken(token);\n        return {\n            address: token,\n            ...tokenInfo,\n            ...tokenMetadata,\n            deployment,\n            rewards,\n            vault,\n            vestedDevBuy,\n            mev,\n        };\n    }\n    /**\n     * Check if a token was deployed via Clawncher\n     */\n    async isClawnchToken(token) {\n        const deployment = await this.getDeploymentInfo(token);\n        return deployment !== null;\n    }\n}\n//# sourceMappingURL=reader.js.map","/**\n * Uniswap V3 & V4 Contract Addresses\n *\n * Official deployment addresses for Base mainnet and Base Sepolia.\n * Source: https://docs.uniswap.org/contracts/v4/deployments\n */\nconst V4_BASE_MAINNET = {\n    poolManager: '0x498581ff718922c3f8e6a244956af099b2652b2b',\n    positionManager: '0x7c5f5a4bbd8fd63184577525326123b519429bdc',\n    positionDescriptor: '0x25d093633990dc94bedeed76c8f3cdaa75f3e7d5',\n    stateView: '0xa3c0c9b65bad0b08107aa264b0f3db444b867a71',\n    quoter: '0x0d5e0f971ed27fbff6c2837bf31316121532048d',\n    universalRouter: '0x6ff5693b99212da76ad316178a184ab56d299b43',\n    permit2: '0x000000000022D473030F116dDEE9F6B43aC78BA3',\n};\nconst V4_BASE_SEPOLIA = {\n    poolManager: '0x05E73354cFDd6745C338b50BcFDfA3Aa6fA03408',\n    positionManager: '0x4b2c77d209d3405f41a037ec6c77f7f5b8e2ca80',\n    positionDescriptor: '0x0000000000000000000000000000000000000000', // not deployed\n    stateView: '0x571291b572ed32ce6751a2cb2486ebee8defb9b4',\n    quoter: '0x4a6513c898fe1b2d0e78d3b0e0a4a151589b1cba',\n    universalRouter: '0x492e6456d9528771018deb9e87ef7750ef184104',\n    permit2: '0x000000000022D473030F116dDEE9F6B43aC78BA3',\n};\nconst V3_BASE_MAINNET = {\n    factory: '0x33128a8fC17869897dcE68Ed026d694621f6FDfD',\n    nonfungiblePositionManager: '0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1',\n    swapRouter: '0x2626664c2603336E57B271c5C0b26F421741e481',\n    swapRouter02: '0x2626664c2603336E57B271c5C0b26F421741e481',\n    quoterV2: '0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a',\n};\nconst V3_BASE_SEPOLIA = {\n    factory: '0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24',\n    nonfungiblePositionManager: '0x27F971cb582BF9E50F397e4d29a5C7A34f11faA2',\n    swapRouter: '0x94cC0AaC535CCDB3C01d6787D6413C739ae12bc4',\n    swapRouter02: '0x94cC0AaC535CCDB3C01d6787D6413C739ae12bc4',\n    quoterV2: '0xC5290058841028F1614F3A6F0F5816cAd0df5E27',\n};\nconst COMMON_BASE_MAINNET = {\n    weth: '0x4200000000000000000000000000000000000006',\n    usdc: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',\n};\nconst COMMON_BASE_SEPOLIA = {\n    weth: '0x4200000000000000000000000000000000000006',\n    usdc: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',\n};\n// ============================================================================\n// Getters\n// ============================================================================\nexport function getUniswapV4Addresses(network = 'mainnet') {\n    return network === 'mainnet' ? V4_BASE_MAINNET : V4_BASE_SEPOLIA;\n}\nexport function getUniswapV3Addresses(network = 'mainnet') {\n    return network === 'mainnet' ? V3_BASE_MAINNET : V3_BASE_SEPOLIA;\n}\nexport function getCommonAddresses(network = 'mainnet') {\n    return network === 'mainnet' ? COMMON_BASE_MAINNET : COMMON_BASE_SEPOLIA;\n}\n/** All Uniswap addresses for a given network */\nexport function getUniswapAddresses(network = 'mainnet') {\n    return {\n        v4: getUniswapV4Addresses(network),\n        v3: getUniswapV3Addresses(network),\n        common: getCommonAddresses(network),\n    };\n}\n//# sourceMappingURL=uniswap-addresses.js.map","/**\n * Uniswap V3 & V4 ABIs\n *\n * Minimal ABIs for the contract functions used by ClawnchLiquidity.\n * We only include the functions we actually call to keep bundle size small.\n */\n// ============================================================================\n// ERC20 (minimal — approve, allowance, balanceOf)\n// Already available via viem's erc20Abi, but defining here for clarity\n// ============================================================================\n// ============================================================================\n// Uniswap V4 - StateView (read-only lens)\n// ============================================================================\nexport const StateViewABI = [\n    {\n        inputs: [{ name: 'poolId', type: 'bytes32' }],\n        name: 'getSlot0',\n        outputs: [\n            { name: 'sqrtPriceX96', type: 'uint160' },\n            { name: 'tick', type: 'int24' },\n            { name: 'protocolFee', type: 'uint24' },\n            { name: 'lpFee', type: 'uint24' },\n        ],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [{ name: 'poolId', type: 'bytes32' }],\n        name: 'getLiquidity',\n        outputs: [{ name: 'liquidity', type: 'uint128' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [\n            { name: 'poolId', type: 'bytes32' },\n            { name: 'owner', type: 'address' },\n            { name: 'tickLower', type: 'int24' },\n            { name: 'tickUpper', type: 'int24' },\n            { name: 'salt', type: 'bytes32' },\n        ],\n        name: 'getPositionInfo',\n        outputs: [\n            { name: 'liquidity', type: 'uint128' },\n            { name: 'feeGrowthInside0LastX128', type: 'uint256' },\n            { name: 'feeGrowthInside1LastX128', type: 'uint256' },\n        ],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [\n            { name: 'poolId', type: 'bytes32' },\n            { name: 'tickLower', type: 'int24' },\n            { name: 'tickUpper', type: 'int24' },\n        ],\n        name: 'getFeeGrowthInside',\n        outputs: [\n            { name: 'feeGrowthInside0X128', type: 'uint256' },\n            { name: 'feeGrowthInside1X128', type: 'uint256' },\n        ],\n        stateMutability: 'view',\n        type: 'function',\n    },\n];\n// ============================================================================\n// Uniswap V4 - PositionManager\n// ============================================================================\nexport const V4PositionManagerABI = [\n    {\n        inputs: [{ name: 'data', type: 'bytes[]' }],\n        name: 'multicall',\n        outputs: [{ name: 'results', type: 'bytes[]' }],\n        stateMutability: 'payable',\n        type: 'function',\n    },\n    {\n        inputs: [{ name: 'tokenId', type: 'uint256' }],\n        name: 'getPoolAndPositionInfo',\n        outputs: [\n            {\n                name: 'poolKey',\n                type: 'tuple',\n                components: [\n                    { name: 'currency0', type: 'address' },\n                    { name: 'currency1', type: 'address' },\n                    { name: 'fee', type: 'uint24' },\n                    { name: 'tickSpacing', type: 'int24' },\n                    { name: 'hooks', type: 'address' },\n                ],\n            },\n            {\n                name: 'info',\n                type: 'tuple',\n                components: [\n                    { name: 'tickLower', type: 'int24' },\n                    { name: 'tickUpper', type: 'int24' },\n                    { name: 'liquidity', type: 'uint128' },\n                ],\n            },\n        ],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [{ name: 'tokenId', type: 'uint256' }],\n        name: 'ownerOf',\n        outputs: [{ name: '', type: 'address' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    {\n        inputs: [{ name: 'owner', type: 'address' }],\n        name: 'balanceOf',\n        outputs: [{ name: '', type: 'uint256' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n];\n// ============================================================================\n// Uniswap V3 - NonfungiblePositionManager\n// ============================================================================\nexport const V3NonfungiblePositionManagerABI = [\n    // mint\n    {\n        inputs: [\n            {\n                name: 'params',\n                type: 'tuple',\n                components: [\n                    { name: 'token0', type: 'address' },\n                    { name: 'token1', type: 'address' },\n                    { name: 'fee', type: 'uint24' },\n                    { name: 'tickLower', type: 'int24' },\n                    { name: 'tickUpper', type: 'int24' },\n                    { name: 'amount0Desired', type: 'uint256' },\n                    { name: 'amount1Desired', type: 'uint256' },\n                    { name: 'amount0Min', type: 'uint256' },\n                    { name: 'amount1Min', type: 'uint256' },\n                    { name: 'recipient', type: 'address' },\n                    { name: 'deadline', type: 'uint256' },\n                ],\n            },\n        ],\n        name: 'mint',\n        outputs: [\n            { name: 'tokenId', type: 'uint256' },\n            { name: 'liquidity', type: 'uint128' },\n            { name: 'amount0', type: 'uint256' },\n            { name: 'amount1', type: 'uint256' },\n        ],\n        stateMutability: 'payable',\n        type: 'function',\n    },\n    // increaseLiquidity\n    {\n        inputs: [\n            {\n                name: 'params',\n                type: 'tuple',\n                components: [\n                    { name: 'tokenId', type: 'uint256' },\n                    { name: 'amount0Desired', type: 'uint256' },\n                    { name: 'amount1Desired', type: 'uint256' },\n                    { name: 'amount0Min', type: 'uint256' },\n                    { name: 'amount1Min', type: 'uint256' },\n                    { name: 'deadline', type: 'uint256' },\n                ],\n            },\n        ],\n        name: 'increaseLiquidity',\n        outputs: [\n            { name: 'liquidity', type: 'uint128' },\n            { name: 'amount0', type: 'uint256' },\n            { name: 'amount1', type: 'uint256' },\n        ],\n        stateMutability: 'payable',\n        type: 'function',\n    },\n    // decreaseLiquidity\n    {\n        inputs: [\n            {\n                name: 'params',\n                type: 'tuple',\n                components: [\n                    { name: 'tokenId', type: 'uint256' },\n                    { name: 'liquidity', type: 'uint128' },\n                    { name: 'amount0Min', type: 'uint256' },\n                    { name: 'amount1Min', type: 'uint256' },\n                    { name: 'deadline', type: 'uint256' },\n                ],\n            },\n        ],\n        name: 'decreaseLiquidity',\n        outputs: [\n            { name: 'amount0', type: 'uint256' },\n            { name: 'amount1', type: 'uint256' },\n        ],\n        stateMutability: 'payable',\n        type: 'function',\n    },\n    // collect\n    {\n        inputs: [\n            {\n                name: 'params',\n                type: 'tuple',\n                components: [\n                    { name: 'tokenId', type: 'uint256' },\n                    { name: 'recipient', type: 'address' },\n                    { name: 'amount0Max', type: 'uint128' },\n                    { name: 'amount1Max', type: 'uint128' },\n                ],\n            },\n        ],\n        name: 'collect',\n        outputs: [\n            { name: 'amount0', type: 'uint256' },\n            { name: 'amount1', type: 'uint256' },\n        ],\n        stateMutability: 'payable',\n        type: 'function',\n    },\n    // burn\n    {\n        inputs: [{ name: 'tokenId', type: 'uint256' }],\n        name: 'burn',\n        outputs: [],\n        stateMutability: 'payable',\n        type: 'function',\n    },\n    // positions (read)\n    {\n        inputs: [{ name: 'tokenId', type: 'uint256' }],\n        name: 'positions',\n        outputs: [\n            { name: 'nonce', type: 'uint96' },\n            { name: 'operator', type: 'address' },\n            { name: 'token0', type: 'address' },\n            { name: 'token1', type: 'address' },\n            { name: 'fee', type: 'uint24' },\n            { name: 'tickLower', type: 'int24' },\n            { name: 'tickUpper', type: 'int24' },\n            { name: 'liquidity', type: 'uint128' },\n            { name: 'feeGrowthInside0LastX128', type: 'uint256' },\n            { name: 'feeGrowthInside1LastX128', type: 'uint256' },\n            { name: 'tokensOwed0', type: 'uint128' },\n            { name: 'tokensOwed1', type: 'uint128' },\n        ],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    // balanceOf\n    {\n        inputs: [{ name: 'owner', type: 'address' }],\n        name: 'balanceOf',\n        outputs: [{ name: '', type: 'uint256' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    // tokenOfOwnerByIndex\n    {\n        inputs: [\n            { name: 'owner', type: 'address' },\n            { name: 'index', type: 'uint256' },\n        ],\n        name: 'tokenOfOwnerByIndex',\n        outputs: [{ name: '', type: 'uint256' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    // ownerOf\n    {\n        inputs: [{ name: 'tokenId', type: 'uint256' }],\n        name: 'ownerOf',\n        outputs: [{ name: '', type: 'address' }],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    // multicall\n    {\n        inputs: [{ name: 'data', type: 'bytes[]' }],\n        name: 'multicall',\n        outputs: [{ name: 'results', type: 'bytes[]' }],\n        stateMutability: 'payable',\n        type: 'function',\n    },\n];\n// ============================================================================\n// Uniswap V4 - PoolManager (write — swap, modifyLiquidity, settle, take)\n// ============================================================================\nexport const V4PoolManagerABI = [\n    // swap\n    {\n        inputs: [\n            {\n                name: 'key',\n                type: 'tuple',\n                components: [\n                    { name: 'currency0', type: 'address' },\n                    { name: 'currency1', type: 'address' },\n                    { name: 'fee', type: 'uint24' },\n                    { name: 'tickSpacing', type: 'int24' },\n                    { name: 'hooks', type: 'address' },\n                ],\n            },\n            {\n                name: 'params',\n                type: 'tuple',\n                components: [\n                    { name: 'zeroForOne', type: 'bool' },\n                    { name: 'amountSpecified', type: 'int256' },\n                    { name: 'sqrtPriceLimitX96', type: 'uint160' },\n                ],\n            },\n            { name: 'hookData', type: 'bytes' },\n        ],\n        name: 'swap',\n        outputs: [{ name: 'swapDelta', type: 'int256' }],\n        stateMutability: 'payable',\n        type: 'function',\n    },\n    // unlock (for flash accounting)\n    {\n        inputs: [{ name: 'data', type: 'bytes' }],\n        name: 'unlock',\n        outputs: [{ name: 'result', type: 'bytes' }],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n];\n// ============================================================================\n// Uniswap V4 - Quoter (quoteExactInputSingle, quoteExactOutputSingle)\n// ============================================================================\nexport const V4QuoterABI = [\n    // quoteExactInputSingle\n    {\n        inputs: [\n            {\n                name: 'params',\n                type: 'tuple',\n                components: [\n                    {\n                        name: 'poolKey',\n                        type: 'tuple',\n                        components: [\n                            { name: 'currency0', type: 'address' },\n                            { name: 'currency1', type: 'address' },\n                            { name: 'fee', type: 'uint24' },\n                            { name: 'tickSpacing', type: 'int24' },\n                            { name: 'hooks', type: 'address' },\n                        ],\n                    },\n                    { name: 'zeroForOne', type: 'bool' },\n                    { name: 'exactAmount', type: 'uint128' },\n                    { name: 'sqrtPriceLimitX96', type: 'uint160' },\n                    { name: 'hookData', type: 'bytes' },\n                ],\n            },\n        ],\n        name: 'quoteExactInputSingle',\n        outputs: [\n            { name: 'amountOut', type: 'uint256' },\n            { name: 'gasEstimate', type: 'uint256' },\n        ],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    // quoteExactOutputSingle\n    {\n        inputs: [\n            {\n                name: 'params',\n                type: 'tuple',\n                components: [\n                    {\n                        name: 'poolKey',\n                        type: 'tuple',\n                        components: [\n                            { name: 'currency0', type: 'address' },\n                            { name: 'currency1', type: 'address' },\n                            { name: 'fee', type: 'uint24' },\n                            { name: 'tickSpacing', type: 'int24' },\n                            { name: 'hooks', type: 'address' },\n                        ],\n                    },\n                    { name: 'zeroForOne', type: 'bool' },\n                    { name: 'exactAmount', type: 'uint128' },\n                    { name: 'sqrtPriceLimitX96', type: 'uint160' },\n                    { name: 'hookData', type: 'bytes' },\n                ],\n            },\n        ],\n        name: 'quoteExactOutputSingle',\n        outputs: [\n            { name: 'amountIn', type: 'uint256' },\n            { name: 'gasEstimate', type: 'uint256' },\n        ],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    // quoteExactInput (multi-hop)\n    {\n        inputs: [\n            {\n                name: 'params',\n                type: 'tuple',\n                components: [\n                    { name: 'exactCurrency', type: 'address' },\n                    { name: 'path', type: 'tuple[]', components: [\n                            {\n                                name: 'poolKey',\n                                type: 'tuple',\n                                components: [\n                                    { name: 'currency0', type: 'address' },\n                                    { name: 'currency1', type: 'address' },\n                                    { name: 'fee', type: 'uint24' },\n                                    { name: 'tickSpacing', type: 'int24' },\n                                    { name: 'hooks', type: 'address' },\n                                ],\n                            },\n                            { name: 'zeroForOne', type: 'bool' },\n                            { name: 'hookData', type: 'bytes' },\n                        ] },\n                    { name: 'exactAmount', type: 'uint128' },\n                ],\n            },\n        ],\n        name: 'quoteExactInput',\n        outputs: [\n            { name: 'amountOut', type: 'uint256' },\n            { name: 'gasEstimate', type: 'uint256' },\n        ],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n];\n// ============================================================================\n// Uniswap V4 - Universal Router V2\n// We only need the execute function — calldata is built off-chain.\n// ============================================================================\nexport const V4UniversalRouterABI = [\n    {\n        inputs: [\n            { name: 'commands', type: 'bytes' },\n            { name: 'inputs', type: 'bytes[]' },\n            { name: 'deadline', type: 'uint256' },\n        ],\n        name: 'execute',\n        outputs: [],\n        stateMutability: 'payable',\n        type: 'function',\n    },\n    // execute without deadline\n    {\n        inputs: [\n            { name: 'commands', type: 'bytes' },\n            { name: 'inputs', type: 'bytes[]' },\n        ],\n        name: 'execute',\n        outputs: [],\n        stateMutability: 'payable',\n        type: 'function',\n    },\n];\n// ============================================================================\n// Permit2 — AllowanceTransfer + SignatureTransfer\n//\n// AllowanceTransfer: on-chain nonce tracking, can set amount+expiration\n//   1. Token owner does ERC20.approve(Permit2, max)\n//   2. Owner signs EIP-712 PermitSingle/PermitBatch granting spender an allowance\n//   3. Spender calls permit() with the sig, then transferFrom()\n//   - OR skip the sig: owner calls Permit2.approve(token,spender,amount,expiration) directly\n//\n// SignatureTransfer: witness-based, single-use nonces\n//   1. Token owner does ERC20.approve(Permit2, max)\n//   2. Owner signs EIP-712 PermitTransferFrom\n//   3. Spender calls permitTransferFrom() with the sig\n// ============================================================================\nexport const Permit2ABI = [\n    // ── AllowanceTransfer reads ──────────────────────────────────────────\n    {\n        inputs: [\n            { name: 'owner', type: 'address' },\n            { name: 'token', type: 'address' },\n            { name: 'spender', type: 'address' },\n        ],\n        name: 'allowance',\n        outputs: [\n            { name: 'amount', type: 'uint160' },\n            { name: 'expiration', type: 'uint48' },\n            { name: 'nonce', type: 'uint48' },\n        ],\n        stateMutability: 'view',\n        type: 'function',\n    },\n    // ── AllowanceTransfer writes ─────────────────────────────────────────\n    // Direct approve (no signature, caller must be the owner)\n    {\n        inputs: [\n            { name: 'token', type: 'address' },\n            { name: 'spender', type: 'address' },\n            { name: 'amount', type: 'uint160' },\n            { name: 'expiration', type: 'uint48' },\n        ],\n        name: 'approve',\n        outputs: [],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    // permit — apply a signed PermitSingle\n    {\n        inputs: [\n            { name: 'owner', type: 'address' },\n            {\n                name: 'permitSingle',\n                type: 'tuple',\n                components: [\n                    {\n                        name: 'details',\n                        type: 'tuple',\n                        components: [\n                            { name: 'token', type: 'address' },\n                            { name: 'amount', type: 'uint160' },\n                            { name: 'expiration', type: 'uint48' },\n                            { name: 'nonce', type: 'uint48' },\n                        ],\n                    },\n                    { name: 'spender', type: 'address' },\n                    { name: 'sigDeadline', type: 'uint256' },\n                ],\n            },\n            { name: 'signature', type: 'bytes' },\n        ],\n        name: 'permit',\n        outputs: [],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    // permit batch — apply a signed PermitBatch\n    {\n        inputs: [\n            { name: 'owner', type: 'address' },\n            {\n                name: 'permitBatch',\n                type: 'tuple',\n                components: [\n                    {\n                        name: 'details',\n                        type: 'tuple[]',\n                        components: [\n                            { name: 'token', type: 'address' },\n                            { name: 'amount', type: 'uint160' },\n                            { name: 'expiration', type: 'uint48' },\n                            { name: 'nonce', type: 'uint48' },\n                        ],\n                    },\n                    { name: 'spender', type: 'address' },\n                    { name: 'sigDeadline', type: 'uint256' },\n                ],\n            },\n            { name: 'signature', type: 'bytes' },\n        ],\n        name: 'permit',\n        outputs: [],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    // transferFrom (single) — spender pulls tokens from owner\n    {\n        inputs: [\n            { name: 'from', type: 'address' },\n            { name: 'to', type: 'address' },\n            { name: 'amount', type: 'uint160' },\n            { name: 'token', type: 'address' },\n        ],\n        name: 'transferFrom',\n        outputs: [],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    // transferFrom (batch) — spender pulls multiple tokens\n    {\n        inputs: [\n            {\n                name: 'transferDetails',\n                type: 'tuple[]',\n                components: [\n                    { name: 'from', type: 'address' },\n                    { name: 'to', type: 'address' },\n                    { name: 'amount', type: 'uint160' },\n                    { name: 'token', type: 'address' },\n                ],\n            },\n        ],\n        name: 'transferFrom',\n        outputs: [],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    // lockdown — revoke all allowances for (token, spender) pairs\n    {\n        inputs: [\n            {\n                name: 'approvals',\n                type: 'tuple[]',\n                components: [\n                    { name: 'token', type: 'address' },\n                    { name: 'spender', type: 'address' },\n                ],\n            },\n        ],\n        name: 'lockdown',\n        outputs: [],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    // invalidateNonces — bulk-invalidate AllowanceTransfer nonces\n    {\n        inputs: [\n            { name: 'token', type: 'address' },\n            { name: 'spender', type: 'address' },\n            { name: 'newNonce', type: 'uint48' },\n        ],\n        name: 'invalidateNonces',\n        outputs: [],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    // ── SignatureTransfer ────────────────────────────────────────────────\n    // permitTransferFrom (single)\n    {\n        inputs: [\n            {\n                name: 'permit',\n                type: 'tuple',\n                components: [\n                    {\n                        name: 'permitted',\n                        type: 'tuple',\n                        components: [\n                            { name: 'token', type: 'address' },\n                            { name: 'amount', type: 'uint256' },\n                        ],\n                    },\n                    { name: 'nonce', type: 'uint256' },\n                    { name: 'deadline', type: 'uint256' },\n                ],\n            },\n            {\n                name: 'transferDetails',\n                type: 'tuple',\n                components: [\n                    { name: 'to', type: 'address' },\n                    { name: 'requestedAmount', type: 'uint256' },\n                ],\n            },\n            { name: 'owner', type: 'address' },\n            { name: 'signature', type: 'bytes' },\n        ],\n        name: 'permitTransferFrom',\n        outputs: [],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    // permitTransferFrom (batch)\n    {\n        inputs: [\n            {\n                name: 'permit',\n                type: 'tuple',\n                components: [\n                    {\n                        name: 'permitted',\n                        type: 'tuple[]',\n                        components: [\n                            { name: 'token', type: 'address' },\n                            { name: 'amount', type: 'uint256' },\n                        ],\n                    },\n                    { name: 'nonce', type: 'uint256' },\n                    { name: 'deadline', type: 'uint256' },\n                ],\n            },\n            {\n                name: 'transferDetails',\n                type: 'tuple[]',\n                components: [\n                    { name: 'to', type: 'address' },\n                    { name: 'requestedAmount', type: 'uint256' },\n                ],\n            },\n            { name: 'owner', type: 'address' },\n            { name: 'signature', type: 'bytes' },\n        ],\n        name: 'permitTransferFrom',\n        outputs: [],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    // permitWitnessTransferFrom (single, with witness)\n    {\n        inputs: [\n            {\n                name: 'permit',\n                type: 'tuple',\n                components: [\n                    {\n                        name: 'permitted',\n                        type: 'tuple',\n                        components: [\n                            { name: 'token', type: 'address' },\n                            { name: 'amount', type: 'uint256' },\n                        ],\n                    },\n                    { name: 'nonce', type: 'uint256' },\n                    { name: 'deadline', type: 'uint256' },\n                ],\n            },\n            {\n                name: 'transferDetails',\n                type: 'tuple',\n                components: [\n                    { name: 'to', type: 'address' },\n                    { name: 'requestedAmount', type: 'uint256' },\n                ],\n            },\n            { name: 'owner', type: 'address' },\n            { name: 'witness', type: 'bytes32' },\n            { name: 'witnessTypeString', type: 'string' },\n            { name: 'signature', type: 'bytes' },\n        ],\n        name: 'permitWitnessTransferFrom',\n        outputs: [],\n        stateMutability: 'nonpayable',\n        type: 'function',\n    },\n    // nonceBitmap — read nonce usage for SignatureTransfer\n    {\n        inputs: [\n            { name: 'owner', type: 'address' },\n            { name: 'word', type: 'uint256' },\n        ],\n        name: 'nonceBitmap',\n        outputs: [\n            { name: 'bitmap', type: 'uint256' },\n        ],\n        stateMutability: 'view',\n        type: 'function',\n    },\n];\n//# sourceMappingURL=uniswap-abis.js.map","/**\n * Multi-chain Uniswap contract address registry.\n *\n * Covers all chains supported by Uniswap V4, V3, and the Trading API.\n * Derived from Uniswap AI's uniswap-driver chain references and\n * swap-integration Universal Router deployment addresses.\n *\n * @see https://github.com/Uniswap/uniswap-ai\n * @see https://docs.uniswap.org/contracts/v4/deployments\n */\nimport { getUniswapV4Addresses, getCommonAddresses } from './uniswap-addresses.js';\n// ============================================================================\n// Permit2 — same on all chains\n// ============================================================================\nconst PERMIT2 = '0x000000000022D473030F116dDEE9F6B43aC78BA3';\nconst ZERO = '0x0000000000000000000000000000000000000000';\n// ============================================================================\n// Chain Configs\n// ============================================================================\nconst CHAINS = {\n    // Ethereum\n    1: {\n        chainId: 1,\n        name: 'Ethereum',\n        slug: 'ethereum',\n        v4: true, v3: true, v2: true,\n        tradingApi: true,\n        blockTimeSeconds: 12,\n        explorer: 'https://etherscan.io',\n        dexScreenerId: 'ethereum',\n        weth: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n        usdc: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',\n        permit2: PERMIT2,\n        v4UniversalRouter: '0x66a9893cc07d91d95644aedd05d03f95e1dba8af',\n        v4PoolManager: '0x000000000004444c5dc75cB358380D2e3dE08A90',\n        v4StateView: ZERO, // TODO: add when available\n        v4Quoter: ZERO,\n        v4PositionManager: ZERO,\n    },\n    // Base — canonical addresses from uniswap-addresses.ts (single source of truth)\n    8453: (() => {\n        const v4 = getUniswapV4Addresses('mainnet');\n        const common = getCommonAddresses('mainnet');\n        return {\n            chainId: 8453,\n            name: 'Base',\n            slug: 'base',\n            v4: true, v3: true, v2: false,\n            tradingApi: true,\n            blockTimeSeconds: 2,\n            explorer: 'https://basescan.org',\n            dexScreenerId: 'base',\n            weth: common.weth,\n            usdc: common.usdc,\n            permit2: PERMIT2,\n            v4UniversalRouter: v4.universalRouter,\n            v4PoolManager: v4.poolManager,\n            v4StateView: v4.stateView,\n            v4Quoter: v4.quoter,\n            v4PositionManager: v4.positionManager,\n        };\n    })(),\n    // Arbitrum\n    42161: {\n        chainId: 42161,\n        name: 'Arbitrum',\n        slug: 'arbitrum',\n        v4: true, v3: true, v2: true,\n        tradingApi: true,\n        blockTimeSeconds: 0.25,\n        explorer: 'https://arbiscan.io',\n        dexScreenerId: 'arbitrum',\n        weth: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1',\n        usdc: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',\n        permit2: PERMIT2,\n        v4UniversalRouter: '0xa51afafe0263b40edaef0df8781ea9aa03e381a3',\n        v4PoolManager: ZERO,\n        v4StateView: ZERO,\n        v4Quoter: ZERO,\n        v4PositionManager: ZERO,\n    },\n    // Optimism\n    10: {\n        chainId: 10,\n        name: 'Optimism',\n        slug: 'optimism',\n        v4: true, v3: true, v2: false,\n        tradingApi: true,\n        blockTimeSeconds: 2,\n        explorer: 'https://optimistic.etherscan.io',\n        dexScreenerId: 'optimism',\n        weth: '0x4200000000000000000000000000000000000006',\n        usdc: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85',\n        permit2: PERMIT2,\n        v4UniversalRouter: '0x851116d9223fabed8e56c0e6b8ad0c31d98b3507',\n        v4PoolManager: ZERO,\n        v4StateView: ZERO,\n        v4Quoter: ZERO,\n        v4PositionManager: ZERO,\n    },\n    // Polygon\n    137: {\n        chainId: 137,\n        name: 'Polygon',\n        slug: 'polygon',\n        v4: false, v3: true, v2: true,\n        tradingApi: true,\n        blockTimeSeconds: 2,\n        explorer: 'https://polygonscan.com',\n        dexScreenerId: 'polygon',\n        weth: '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270', // WMATIC\n        usdc: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',\n        permit2: PERMIT2,\n        v4UniversalRouter: '0x1095692a6237d83c6a72f3f5efedb9a670c49223',\n        v4PoolManager: ZERO,\n        v4StateView: ZERO,\n        v4Quoter: ZERO,\n        v4PositionManager: ZERO,\n    },\n    // BNB Chain\n    56: {\n        chainId: 56,\n        name: 'BNB Chain',\n        slug: 'bnb',\n        v4: true, v3: true, v2: false,\n        tradingApi: true,\n        blockTimeSeconds: 3,\n        explorer: 'https://bscscan.com',\n        dexScreenerId: 'bsc',\n        weth: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c', // WBNB\n        usdc: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d',\n        permit2: PERMIT2,\n        v4UniversalRouter: '0x1906c1d672b88cd1b9ac7593301ca990f94eae07',\n        v4PoolManager: ZERO,\n        v4StateView: ZERO,\n        v4Quoter: ZERO,\n        v4PositionManager: ZERO,\n    },\n    // Unichain\n    130: {\n        chainId: 130,\n        name: 'Unichain',\n        slug: 'unichain',\n        v4: true, v3: true, v2: false,\n        tradingApi: true,\n        blockTimeSeconds: 1,\n        explorer: 'https://unichain.blockscout.com',\n        dexScreenerId: 'unichain',\n        weth: '0x4200000000000000000000000000000000000006',\n        usdc: '0x078D782b760474a361dDA0AF3839290b0EF57AD6',\n        permit2: PERMIT2,\n        v4UniversalRouter: '0xef740bf23acae26f6492b10de645d6b98dc8eaf3',\n        v4PoolManager: ZERO,\n        v4StateView: ZERO,\n        v4Quoter: ZERO,\n        v4PositionManager: ZERO,\n    },\n    // Avalanche\n    43114: {\n        chainId: 43114,\n        name: 'Avalanche',\n        slug: 'avalanche',\n        v4: true, v3: true, v2: false,\n        tradingApi: true,\n        blockTimeSeconds: 2,\n        explorer: 'https://snowtrace.io',\n        dexScreenerId: 'avalanche',\n        weth: '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7', // WAVAX\n        usdc: '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E',\n        permit2: PERMIT2,\n        v4UniversalRouter: '0x94b75331ae8d42c1b61065089b7d48fe14aa73b7',\n        v4PoolManager: ZERO,\n        v4StateView: ZERO,\n        v4Quoter: ZERO,\n        v4PositionManager: ZERO,\n    },\n    // Celo\n    42220: {\n        chainId: 42220,\n        name: 'Celo',\n        slug: 'celo',\n        v4: true, v3: true, v2: false,\n        tradingApi: true,\n        blockTimeSeconds: 5,\n        explorer: 'https://celoscan.io',\n        dexScreenerId: 'celo',\n        weth: '0x471EcE3750Da237f93B8E339c536989b8978a438', // CELO\n        usdc: '0xcebA9300f2b948710d2653dD7B07f33A8B32118C',\n        permit2: PERMIT2,\n        v4UniversalRouter: '0xcb695bc5d3aa22cad1e6df07801b061a05a0233a',\n        v4PoolManager: ZERO,\n        v4StateView: ZERO,\n        v4Quoter: ZERO,\n        v4PositionManager: ZERO,\n    },\n    // Blast\n    81457: {\n        chainId: 81457,\n        name: 'Blast',\n        slug: 'blast',\n        v4: true, v3: true, v2: false,\n        tradingApi: true,\n        blockTimeSeconds: 2,\n        explorer: 'https://blastscan.io',\n        dexScreenerId: 'blast',\n        weth: '0x4300000000000000000000000000000000000004',\n        usdc: ZERO,\n        permit2: PERMIT2,\n        v4UniversalRouter: '0xeabbcb3e8e415306207ef514f660a3f820025be3',\n        v4PoolManager: ZERO,\n        v4StateView: ZERO,\n        v4Quoter: ZERO,\n        v4PositionManager: ZERO,\n    },\n    // Zora\n    7777777: {\n        chainId: 7777777,\n        name: 'Zora',\n        slug: 'zora',\n        v4: true, v3: true, v2: false,\n        tradingApi: true,\n        blockTimeSeconds: 2,\n        explorer: 'https://explorer.zora.energy',\n        dexScreenerId: 'zora',\n        weth: '0x4200000000000000000000000000000000000006',\n        usdc: ZERO,\n        permit2: PERMIT2,\n        v4UniversalRouter: '0x3315ef7ca28db74abadc6c44570efdf06b04b020',\n        v4PoolManager: ZERO,\n        v4StateView: ZERO,\n        v4Quoter: ZERO,\n        v4PositionManager: ZERO,\n    },\n    // World Chain\n    480: {\n        chainId: 480,\n        name: 'World Chain',\n        slug: 'worldchain',\n        v4: true, v3: true, v2: false,\n        tradingApi: true,\n        blockTimeSeconds: 2,\n        explorer: 'https://worldchain-mainnet.explorer.alchemy.com',\n        dexScreenerId: 'worldchain',\n        weth: '0x4200000000000000000000000000000000000006',\n        usdc: ZERO,\n        permit2: PERMIT2,\n        v4UniversalRouter: '0x8ac7bee993bb44dab564ea4bc9ea67bf9eb5e743',\n        v4PoolManager: ZERO,\n        v4StateView: ZERO,\n        v4Quoter: ZERO,\n        v4PositionManager: ZERO,\n    },\n    // Soneium\n    1868: {\n        chainId: 1868,\n        name: 'Soneium',\n        slug: 'soneium',\n        v4: true, v3: false, v2: false,\n        tradingApi: true,\n        blockTimeSeconds: 2,\n        explorer: 'https://soneium.blockscout.com',\n        dexScreenerId: 'soneium',\n        weth: '0x4200000000000000000000000000000000000006',\n        usdc: ZERO,\n        permit2: PERMIT2,\n        v4UniversalRouter: '0x4cded7edf52c8aa5259a54ec6a3ce7c6d2a455df',\n        v4PoolManager: ZERO,\n        v4StateView: ZERO,\n        v4Quoter: ZERO,\n        v4PositionManager: ZERO,\n    },\n    // zkSync\n    324: {\n        chainId: 324,\n        name: 'zkSync Era',\n        slug: 'zksync',\n        v4: false, v3: true, v2: false,\n        tradingApi: true,\n        blockTimeSeconds: 1,\n        explorer: 'https://explorer.zksync.io',\n        dexScreenerId: 'zksync',\n        weth: '0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91',\n        usdc: '0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4',\n        permit2: PERMIT2,\n        v4UniversalRouter: ZERO,\n        v4PoolManager: ZERO,\n        v4StateView: ZERO,\n        v4Quoter: ZERO,\n        v4PositionManager: ZERO,\n    },\n    // Monad\n    143: {\n        chainId: 143,\n        name: 'Monad',\n        slug: 'monad',\n        v4: true, v3: false, v2: false,\n        tradingApi: true,\n        blockTimeSeconds: 1,\n        explorer: 'https://monad.blockscout.com',\n        dexScreenerId: 'monad',\n        weth: ZERO,\n        usdc: ZERO,\n        permit2: PERMIT2,\n        v4UniversalRouter: '0x0d97dc33264bfc1c226207428a79b26757fb9dc3',\n        v4PoolManager: ZERO,\n        v4StateView: ZERO,\n        v4Quoter: ZERO,\n        v4PositionManager: ZERO,\n    },\n};\n// ============================================================================\n// Getters\n// ============================================================================\n/** Get config for a specific chain ID. Returns undefined if not supported. */\nexport function getUniswapChain(chainId) {\n    return CHAINS[chainId];\n}\n/** Get all supported chain configs. */\nexport function getAllUniswapChains() {\n    return Object.values(CHAINS);\n}\n/** Get chains that support the Uniswap Trading API. */\nexport function getTradingApiChains() {\n    return Object.values(CHAINS).filter(c => c.tradingApi);\n}\n/** Get chains that have V4 deployed. */\nexport function getV4Chains() {\n    return Object.values(CHAINS).filter(c => c.v4);\n}\n/** Get chains that have V3 deployed. */\nexport function getV3Chains() {\n    return Object.values(CHAINS).filter(c => c.v3);\n}\n/** Get chain ID from a slug (e.g. 'base' -> 8453). */\nexport function chainIdFromSlug(slug) {\n    const chain = Object.values(CHAINS).find(c => c.slug === slug);\n    return chain?.chainId;\n}\n/** Get chain slug from a chain ID (e.g. 8453 -> 'base'). */\nexport function chainSlugFromId(chainId) {\n    return CHAINS[chainId]?.slug;\n}\n/** All supported chain IDs. */\nexport const SUPPORTED_CHAIN_IDS = Object.keys(CHAINS).map(Number);\n/** Uniswap deep link base URL. */\nexport const UNISWAP_APP_URL = 'https://app.uniswap.org';\nexport const FEE_TIERS = [\n    { fee: 100, tickSpacing: 1, label: '0.01%', description: 'Stablecoins (USDC/USDT)' },\n    { fee: 500, tickSpacing: 10, label: '0.05%', description: 'Correlated pairs (ETH/stETH)' },\n    { fee: 3000, tickSpacing: 60, label: '0.30%', description: 'Most pairs (default)' },\n    { fee: 10000, tickSpacing: 200, label: '1.00%', description: 'Exotic / volatile pairs' },\n];\n/** Get the default fee tier for a given pair type. */\nexport function getDefaultFeeTier(pairType = 'major') {\n    switch (pairType) {\n        case 'stable': return FEE_TIERS[0];\n        case 'correlated': return FEE_TIERS[1];\n        case 'major': return FEE_TIERS[2];\n        case 'volatile': return FEE_TIERS[3];\n    }\n}\n//# sourceMappingURL=uniswap-chains.js.map","/**\n * UniswapQuoter — On-chain V4 quote simulation + price impact estimation.\n *\n * Uses the deployed V4 Quoter contract to simulate swaps without executing\n * them. This works even without a Trading API key — it's purely on-chain.\n *\n * Supports:\n *   - Single-pool exact input/output quotes\n *   - Price impact calculation\n *   - Pool discovery for Clawncher tokens\n *   - Multi-chain via uniswap-chains registry\n *\n * @see https://docs.uniswap.org/contracts/v4/reference/periphery/interfaces/IQuoter\n */\nimport { V4QuoterABI, StateViewABI } from './uniswap-abis.js';\nimport { getUniswapChain } from './uniswap-chains.js';\nimport { getUniswapV4Addresses } from './uniswap-addresses.js';\nimport { ClawnchErrorCode, ClawnchDeployError } from './errors.js';\nimport { ClawnchReader } from './reader.js';\n// ============================================================================\n// Constants\n// ============================================================================\nconst Q96 = 2n ** 96n;\nconst ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';\n// Min/max sqrt price for Uniswap V4 (from TickMath)\nconst MIN_SQRT_PRICE = 4295128739n + 1n; // TickMath.MIN_SQRT_PRICE + 1\nconst MAX_SQRT_PRICE = 1461446703485210103287273052203988822378723970342n - 1n; // TickMath.MAX_SQRT_PRICE - 1\n// ============================================================================\n// UniswapQuoter\n// ============================================================================\nexport class UniswapQuoter {\n    publicClient;\n    chainId;\n    network;\n    chainConfig;\n    constructor(config) {\n        this.publicClient = config.publicClient;\n        this.chainId = config.chainId ?? 8453;\n        this.network = config.network ?? 'mainnet';\n        this.chainConfig = getUniswapChain(this.chainId);\n    }\n    /** Get the V4 Quoter address for the current chain */\n    getQuoterAddress() {\n        // For Base, use the known address from uniswap-addresses.ts\n        if (this.chainId === 8453 || this.chainId === 84532) {\n            const v4 = getUniswapV4Addresses(this.network);\n            return v4.quoter;\n        }\n        // For other chains, use the chain config\n        if (this.chainConfig?.v4Quoter && this.chainConfig.v4Quoter !== ZERO_ADDRESS) {\n            return this.chainConfig.v4Quoter;\n        }\n        throw new ClawnchDeployError(ClawnchErrorCode.FEATURE_NOT_AVAILABLE, `V4 Quoter not available on chain ${this.chainId}`);\n    }\n    /** Get the StateView address for the current chain */\n    getStateViewAddress() {\n        if (this.chainId === 8453 || this.chainId === 84532) {\n            const v4 = getUniswapV4Addresses(this.network);\n            return v4.stateView;\n        }\n        if (this.chainConfig?.v4StateView && this.chainConfig.v4StateView !== ZERO_ADDRESS) {\n            return this.chainConfig.v4StateView;\n        }\n        throw new ClawnchDeployError(ClawnchErrorCode.FEATURE_NOT_AVAILABLE, `V4 StateView not available on chain ${this.chainId}`);\n    }\n    // ==========================================================================\n    // Pool State Reading\n    // ==========================================================================\n    /**\n     * Read current pool state from StateView.\n     */\n    async getPoolState(poolKey) {\n        const stateView = this.getStateViewAddress();\n        const poolId = await this.computePoolId(poolKey);\n        const [slot0, liquidity] = await Promise.all([\n            this.publicClient.readContract({\n                address: stateView,\n                abi: StateViewABI,\n                functionName: 'getSlot0',\n                args: [poolId],\n            }),\n            this.publicClient.readContract({\n                address: stateView,\n                abi: StateViewABI,\n                functionName: 'getLiquidity',\n                args: [poolId],\n            }),\n        ]);\n        return {\n            sqrtPriceX96: slot0[0],\n            tick: Number(slot0[1]),\n            liquidity: liquidity,\n            protocolFee: Number(slot0[2]),\n            lpFee: Number(slot0[3]),\n        };\n    }\n    /**\n     * Compute pool ID from pool key (keccak256 of abi-encoded key).\n     */\n    async computePoolId(poolKey) {\n        const { keccak256, encodeAbiParameters } = await import('viem');\n        return keccak256(encodeAbiParameters([\n            { type: 'address' },\n            { type: 'address' },\n            { type: 'uint24' },\n            { type: 'int24' },\n            { type: 'address' },\n        ], [\n            poolKey.currency0,\n            poolKey.currency1,\n            poolKey.fee,\n            poolKey.tickSpacing,\n            poolKey.hooks,\n        ]));\n    }\n    // ==========================================================================\n    // Quoting\n    // ==========================================================================\n    /**\n     * Quote an exact input swap (sell a fixed amount, get variable output).\n     *\n     * Uses the V4 Quoter's `quoteExactInputSingle` via `eth_call` simulation.\n     * The Quoter intentionally reverts with the result — viem handles this\n     * via `simulateContract` or we catch the revert.\n     */\n    async quoteExactInput(params) {\n        const quoter = this.getQuoterAddress();\n        const sqrtPriceLimit = params.sqrtPriceLimitX96 ??\n            (params.zeroForOne ? MIN_SQRT_PRICE : MAX_SQRT_PRICE);\n        try {\n            // The V4 Quoter works by simulating a swap and reverting with the result.\n            // We use eth_call (readContract) which catches the revert output.\n            const result = await this.publicClient.readContract({\n                address: quoter,\n                abi: V4QuoterABI,\n                functionName: 'quoteExactInputSingle',\n                args: [{\n                        poolKey: {\n                            currency0: params.poolKey.currency0,\n                            currency1: params.poolKey.currency1,\n                            fee: params.poolKey.fee,\n                            tickSpacing: params.poolKey.tickSpacing,\n                            hooks: params.poolKey.hooks,\n                        },\n                        zeroForOne: params.zeroForOne,\n                        exactAmount: params.amount,\n                        sqrtPriceLimitX96: sqrtPriceLimit,\n                        hookData: params.hookData ?? '0x',\n                    }],\n            });\n            const amountOut = result[0];\n            const gasEstimate = result[1];\n            // Calculate price impact\n            const impact = await this.calculatePriceImpact(params.poolKey, params.zeroForOne, params.amount, amountOut);\n            return {\n                quotedAmount: amountOut,\n                gasEstimate,\n                ...impact,\n            };\n        }\n        catch (err) {\n            // The quoter may revert with encoded output — try to parse it\n            if (err.cause?.data) {\n                return this.parseQuoterRevert(err.cause.data, params);\n            }\n            throw new ClawnchDeployError(ClawnchErrorCode.RPC_ERROR, `V4 Quoter quoteExactInputSingle failed: ${err.message}`);\n        }\n    }\n    /**\n     * Quote an exact output swap (buy a fixed amount, pay variable input).\n     */\n    async quoteExactOutput(params) {\n        const quoter = this.getQuoterAddress();\n        const sqrtPriceLimit = params.sqrtPriceLimitX96 ??\n            (params.zeroForOne ? MIN_SQRT_PRICE : MAX_SQRT_PRICE);\n        try {\n            const result = await this.publicClient.readContract({\n                address: quoter,\n                abi: V4QuoterABI,\n                functionName: 'quoteExactOutputSingle',\n                args: [{\n                        poolKey: {\n                            currency0: params.poolKey.currency0,\n                            currency1: params.poolKey.currency1,\n                            fee: params.poolKey.fee,\n                            tickSpacing: params.poolKey.tickSpacing,\n                            hooks: params.poolKey.hooks,\n                        },\n                        zeroForOne: params.zeroForOne,\n                        exactAmount: params.amount,\n                        sqrtPriceLimitX96: sqrtPriceLimit,\n                        hookData: params.hookData ?? '0x',\n                    }],\n            });\n            const amountIn = result[0];\n            const gasEstimate = result[1];\n            const impact = await this.calculatePriceImpact(params.poolKey, params.zeroForOne, amountIn, params.amount);\n            return {\n                quotedAmount: amountIn,\n                gasEstimate,\n                ...impact,\n            };\n        }\n        catch (err) {\n            if (err.cause?.data) {\n                return this.parseQuoterRevert(err.cause.data, params);\n            }\n            throw new ClawnchDeployError(ClawnchErrorCode.RPC_ERROR, `V4 Quoter quoteExactOutputSingle failed: ${err.message}`);\n        }\n    }\n    // ==========================================================================\n    // Price Impact\n    // ==========================================================================\n    /**\n     * Calculate price impact for a swap.\n     *\n     * Price impact = (executionPrice - marketPrice) / marketPrice\n     *\n     * For exact input: executionPrice = amountOut / amountIn\n     * Market price comes from current pool sqrtPriceX96.\n     */\n    async calculatePriceImpact(poolKey, zeroForOne, amountIn, amountOut) {\n        try {\n            const state = await this.getPoolState(poolKey);\n            if (state.sqrtPriceX96 === 0n || state.liquidity === 0n) {\n                return { priceImpact: null, currentPrice: null, priceAfterSwap: null };\n            }\n            // Current market price (token1/token0)\n            const currentPrice = this.sqrtPriceX96ToPrice(state.sqrtPriceX96);\n            // Execution price from the quote\n            // If zeroForOne: selling currency0, buying currency1\n            //   executionPrice = amountOut / amountIn (currency1 per currency0)\n            // If oneForZero: selling currency1, buying currency0\n            //   executionPrice = amountIn / amountOut (currency1 per currency0)\n            let executionPrice;\n            if (zeroForOne) {\n                executionPrice = Number(amountOut) / Number(amountIn);\n            }\n            else {\n                executionPrice = Number(amountIn) / Number(amountOut);\n            }\n            // Price impact (negative = unfavorable)\n            const priceImpact = currentPrice > 0\n                ? (executionPrice - currentPrice) / currentPrice\n                : null;\n            return {\n                priceImpact,\n                currentPrice,\n                priceAfterSwap: executionPrice,\n            };\n        }\n        catch {\n            return { priceImpact: null, currentPrice: null, priceAfterSwap: null };\n        }\n    }\n    /**\n     * Get estimated price impact without executing a full quote.\n     *\n     * Uses the simplified formula:\n     *   impact ≈ amountIn / (2 * liquidityInPool)\n     *\n     * This is a rough estimate — use quoteExactInput for precision.\n     */\n    async estimatePriceImpact(poolKey, amountIn) {\n        const state = await this.getPoolState(poolKey);\n        if (state.liquidity === 0n)\n            return 1; // 100% impact if no liquidity\n        // Simplified: impact ≈ amount / (2 * liquidity)\n        return Number(amountIn) / (2 * Number(state.liquidity));\n    }\n    // ==========================================================================\n    // Utility\n    // ==========================================================================\n    /** Convert sqrtPriceX96 to a float price (token1/token0) */\n    sqrtPriceX96ToPrice(sqrtPriceX96) {\n        if (sqrtPriceX96 === 0n)\n            return 0;\n        const sqrtPrice = Number(sqrtPriceX96) / Number(Q96);\n        return sqrtPrice * sqrtPrice;\n    }\n    /** Convert a float price to sqrtPriceX96 */\n    priceToSqrtPriceX96(price) {\n        if (price <= 0)\n            return 0n;\n        const sqrtPrice = Math.sqrt(price);\n        return BigInt(Math.floor(sqrtPrice * Number(Q96)));\n    }\n    /**\n     * Check if a pool exists and has liquidity.\n     */\n    async isPoolActive(poolKey) {\n        try {\n            const state = await this.getPoolState(poolKey);\n            return state.sqrtPriceX96 > 0n && state.liquidity > 0n;\n        }\n        catch {\n            return false;\n        }\n    }\n    /**\n     * Get the WETH address for the current chain.\n     */\n    getWethAddress() {\n        if (this.chainConfig)\n            return this.chainConfig.weth;\n        throw new ClawnchDeployError(ClawnchErrorCode.INVALID_CHAIN, `Cannot determine WETH address for chain ${this.chainId}`);\n    }\n    /**\n     * Build a pool key for a token paired with WETH.\n     *\n     * Automatically sorts currency0/currency1 (lower address first).\n     */\n    buildWethPoolKey(token, fee = 3000, tickSpacing = 60, hooks = ZERO_ADDRESS) {\n        const weth = this.getWethAddress();\n        const tokenLower = token.toLowerCase();\n        const wethLower = weth.toLowerCase();\n        const [currency0, currency1] = tokenLower < wethLower\n            ? [token, weth]\n            : [weth, token];\n        return { currency0, currency1, fee, tickSpacing, hooks };\n    }\n    /**\n     * Get the USDC address for the current chain.\n     */\n    getUsdcAddress() {\n        if (this.chainConfig?.usdc)\n            return this.chainConfig.usdc;\n        // Fallback for Base (not all chain configs may have USDC)\n        if (this.chainId === 8453)\n            return '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';\n        if (this.chainId === 84532)\n            return '0x036CbD53842c5426634e7929541eC2318f3dCF7e';\n        throw new ClawnchDeployError(ClawnchErrorCode.INVALID_CHAIN, `Cannot determine USDC address for chain ${this.chainId}`);\n    }\n    /**\n     * Build a pool key for a token paired with USDC.\n     *\n     * Automatically sorts currency0/currency1 (lower address first).\n     * USDC pairs use 500 fee / 10 tick spacing by default (stablecoin convention).\n     */\n    buildUsdcPoolKey(token, fee = 500, tickSpacing = 10, hooks = ZERO_ADDRESS) {\n        const usdc = this.getUsdcAddress();\n        const tokenLower = token.toLowerCase();\n        const usdcLower = usdc.toLowerCase();\n        const [currency0, currency1] = tokenLower < usdcLower\n            ? [token, usdc]\n            : [usdc, token];\n        return { currency0, currency1, fee, tickSpacing, hooks };\n    }\n    /**\n     * Build a pool key for a token paired with either WETH or USDC.\n     *\n     * @param token - Token address\n     * @param pairedWith - 'WETH' (default) or 'USDC'\n     */\n    buildPairedPoolKey(token, pairedWith = 'WETH', fee, tickSpacing, hooks) {\n        if (pairedWith === 'USDC') {\n            return this.buildUsdcPoolKey(token, fee ?? 500, tickSpacing ?? 10, hooks ?? ZERO_ADDRESS);\n        }\n        return this.buildWethPoolKey(token, fee ?? 3000, tickSpacing ?? 60, hooks ?? ZERO_ADDRESS);\n    }\n    /**\n     * Determine if selling token for WETH requires zeroForOne or oneForZero.\n     */\n    isTokenCurrency0(token) {\n        const weth = this.getWethAddress();\n        return token.toLowerCase() < weth.toLowerCase();\n    }\n    // ==========================================================================\n    // Clawnch-native: Auto-discover pool keys from LP locker\n    // ==========================================================================\n    /**\n     * Build a pool key for a Clawnch token by reading its deployment data\n     * from the LP locker contract.\n     *\n     * This is the SDK's killer feature — Clawnch tokens have their pool key\n     * (including the correct hook address) stored on-chain in the LP locker.\n     * No manual configuration needed. This works for ANY token deployed\n     * through Clawnch, including tokens with MEV hooks, custom fee tiers,\n     * and non-standard tick spacings.\n     *\n     * Falls back to `buildWethPoolKey()` (zero hook, 3000 fee) if the token\n     * is not a Clawnch token.\n     *\n     * @param token - Token address (must be on Base)\n     * @returns Pool key with correct hook, fee, and tick spacing\n     */\n    async buildPoolKeyFromToken(token) {\n        const rewards = await this.getTokenRewards(token);\n        if (rewards) {\n            return {\n                currency0: rewards.poolKey.currency0,\n                currency1: rewards.poolKey.currency1,\n                fee: rewards.poolKey.fee,\n                tickSpacing: rewards.poolKey.tickSpacing,\n                hooks: rewards.poolKey.hooks,\n            };\n        }\n        // Not a Clawnch token — fall back to generic WETH pool key\n        return this.buildWethPoolKey(token);\n    }\n    /**\n     * Get the full token reward info from the Clawnch LP locker.\n     *\n     * Returns null if the token wasn't deployed through Clawnch.\n     */\n    async getTokenRewards(token) {\n        // Only works on Base (Clawnch's chain)\n        if (this.chainId !== 8453 && this.chainId !== 84532)\n            return null;\n        try {\n            const reader = new ClawnchReader({\n                publicClient: this.publicClient,\n                network: this.network,\n            });\n            return await reader.getTokenRewards(token);\n        }\n        catch {\n            return null;\n        }\n    }\n    /**\n     * One-call quote for any Clawnch token: auto-discovers pool key,\n     * determines swap direction, and returns the quote.\n     *\n     * This replaces the 3-step manual flow of:\n     *   1. Get pool key from LP locker\n     *   2. Determine zeroForOne from paired token position\n     *   3. Call quoteExactInput\n     *\n     * Works for both WETH-paired and USDC-paired tokens — the pool key\n     * is read from chain so the correct paired token is auto-detected.\n     *\n     * @param token - Clawnch token address\n     * @param amount - Amount to swap in paired token units (raw units) for buy, or token units for sell\n     * @param direction - 'buy' (PairedToken→Token) or 'sell' (Token→PairedToken)\n     */\n    async quoteClawnchToken(token, amount, direction = 'buy') {\n        const poolKey = await this.buildPoolKeyFromToken(token);\n        // Determine token position from the actual pool key (works for WETH and USDC pairs)\n        const tokenIsCurrency0 = poolKey.currency0.toLowerCase() === token.toLowerCase();\n        // buy = PairedToken→Token: selling paired token for token\n        // sell = Token→PairedToken: selling token for paired token\n        const zeroForOne = direction === 'buy' ? !tokenIsCurrency0 : tokenIsCurrency0;\n        const quote = await this.quoteExactInput({\n            poolKey,\n            zeroForOne,\n            amount,\n        });\n        return { ...quote, poolKey };\n    }\n    // ==========================================================================\n    // Internal\n    // ==========================================================================\n    /**\n     * Try to parse a quoter revert (the V4 quoter reverts with encoded results).\n     */\n    async parseQuoterRevert(data, params) {\n        try {\n            // The quoter reverts with abi.encode(uint256 amount, uint256 gasEstimate)\n            const { decodeAbiParameters } = await import('viem');\n            const decoded = decodeAbiParameters([{ type: 'uint256' }, { type: 'uint256' }], data);\n            return {\n                quotedAmount: decoded[0],\n                gasEstimate: decoded[1],\n                priceImpact: null,\n                currentPrice: null,\n                priceAfterSwap: null,\n            };\n        }\n        catch {\n            throw new ClawnchDeployError(ClawnchErrorCode.RPC_ERROR, 'Failed to decode V4 Quoter revert data');\n        }\n    }\n}\n//# sourceMappingURL=uniswap-quoter.js.map"],"x_google_ignoreList":[0,1,2,3,4,5,6,7],"mappings":";;;;;;;;;;;;;AAUA,IAAW;CACV,SAAU,kBAAkB;AAEzB,kBAAiB,iBAAiB;AAClC,kBAAiB,kBAAkB;AACnC,kBAAiB,oBAAoB;AACrC,kBAAiB,qBAAqB;AAEtC,kBAAiB,2BAA2B;AAC5C,kBAAiB,kCAAkC;AAEnD,kBAAiB,mBAAmB;AACpC,kBAAiB,iBAAiB;AAClC,kBAAiB,wBAAwB;AAEzC,kBAAiB,kBAAkB;AACnC,kBAAiB,uBAAuB;AAExC,kBAAiB,2BAA2B;AAE5C,kBAAiB,mBAAmB;AAEpC,kBAAiB,eAAe;AAChC,kBAAiB,aAAa;AAE9B,kBAAiB,sBAAsB;GACxC,qBAAqB,mBAAmB,EAAE,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AA0B/C,IAAa,qBAAb,cAAwC,MAAM;CAC1C;CACA;CACA,OAAO;CACP,YAAY,MAAM,SAAS,OAAO;AAC9B,QAAM,QAAQ;AACd,OAAK,OAAO;AACZ,OAAK,QAAQ;;;;;;;;;;;;;;AAuBrB,eAAsB,UAAU,IAAI,aAAa,GAAG,cAAc,KAAM;CACpE,IAAI;AACJ,MAAK,IAAI,UAAU,GAAG,WAAW,YAAY,UACzC,KAAI;AACA,SAAO,MAAM,IAAI;UAEd,KAAK;AACR,cAAY;AAEZ,MAAI,eAAe;OACM;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;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