@steerprotocol/sdk 3.7.2 → 3.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -17326,58 +17326,420 @@ var SubgraphClient = class {
17326
17326
  }
17327
17327
  };
17328
17328
  //#endregion
17329
- //#region src/base/vault/utils.ts
17330
- const GLOBAL_STATE_ABI = [{
17331
- inputs: [],
17332
- name: "globalState",
17333
- outputs: [
17334
- {
17335
- internalType: "uint160",
17336
- name: "price",
17337
- type: "uint160"
17338
- },
17329
+ //#region src/pool-lifecycle/abis/v4.ts
17330
+ /** Minimal authoritative IPoolManager surface used by the V4 lifecycle adapter. */
17331
+ const v4PoolManagerAbi = parseAbi(["function initialize((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) key, uint160 sqrtPriceX96) returns (int24 tick)", "event Initialize(bytes32 indexed id, address indexed currency0, address indexed currency1, uint24 fee, int24 tickSpacing, address hooks, uint160 sqrtPriceX96, int24 tick)"]);
17332
+ /** Minimal StateView/ImmutableState surface used for deployment and state checks. */
17333
+ const v4StateViewAbi = parseAbi(["function poolManager() view returns (address)", "function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)"]);
17334
+ //#endregion
17335
+ //#region src/pool-lifecycle/math.ts
17336
+ /** The smallest sqrt price accepted by Uniswap TickMath, inclusive. */
17337
+ const MIN_SQRT_RATIO = 4295128739n;
17338
+ /** The largest TickMath sqrt-price boundary, which is not itself valid. */
17339
+ const MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342n;
17340
+ const ZERO_ADDRESS$3 = "0x0000000000000000000000000000000000000000";
17341
+ const MAX_ERC20_DECIMALS = 255;
17342
+ function greatestCommonDivisor(a, b) {
17343
+ let left = a;
17344
+ let right = b;
17345
+ while (right !== 0n) {
17346
+ const remainder = left % right;
17347
+ left = right;
17348
+ right = remainder;
17349
+ }
17350
+ return left;
17351
+ }
17352
+ function checksumAddress(value, label, allowZero) {
17353
+ if (typeof value !== "string" || !isAddress(value, { strict: true })) throw new TypeError(`${label} must be a valid EVM address`);
17354
+ const address = getAddress(value);
17355
+ if (!allowZero && address === ZERO_ADDRESS$3) throw new RangeError(`${label} must not be the zero address`);
17356
+ return address;
17357
+ }
17358
+ function assertErc20Decimals(value, label) {
17359
+ if (!Number.isSafeInteger(value) || value < 0 || value > MAX_ERC20_DECIMALS) throw new RangeError(`${label} must be an integer from 0 through 255`);
17360
+ }
17361
+ function assertPositiveFraction(value) {
17362
+ if (typeof value?.numerator !== "bigint" || typeof value?.denominator !== "bigint") throw new TypeError("quotePerBase must contain bigint numerator and denominator values");
17363
+ if (value.numerator <= 0n) throw new RangeError("quotePerBase numerator must be greater than zero");
17364
+ if (value.denominator <= 0n) throw new RangeError("quotePerBase denominator must be greater than zero");
17365
+ }
17366
+ /**
17367
+ * Parses an unsigned, fixed-point decimal string without converting through a
17368
+ * JavaScript number. Signs, exponent notation, whitespace, and omitted whole
17369
+ * or fractional digits are rejected. The returned fraction is reduced.
17370
+ */
17371
+ function parseExactDecimal(value) {
17372
+ if (typeof value !== "string") throw new TypeError("Decimal value must be provided as a string");
17373
+ const match = /^([0-9]+)(?:\.([0-9]+))?$/.exec(value);
17374
+ if (match === null || match[0] !== value) throw new TypeError("Decimal value must use unsigned fixed-point notation, for example \"123.45\"");
17375
+ const wholeDigits = match[1];
17376
+ const fractionalDigits = match[2] ?? "";
17377
+ const numerator = BigInt(`${wholeDigits}${fractionalDigits}`);
17378
+ if (numerator === 0n) return {
17379
+ numerator: 0n,
17380
+ denominator: 1n
17381
+ };
17382
+ const denominator = 10n ** BigInt(fractionalDigits.length);
17383
+ const divisor = greatestCommonDivisor(numerator, denominator);
17384
+ return {
17385
+ numerator: numerator / divisor,
17386
+ denominator: denominator / divisor
17387
+ };
17388
+ }
17389
+ /**
17390
+ * Validates, checksums, and sorts two distinct non-zero ERC20 addresses.
17391
+ */
17392
+ function sortErc20Pair(tokenA, tokenB) {
17393
+ const normalizedTokenA = checksumAddress(tokenA, "tokenA", false);
17394
+ const normalizedTokenB = checksumAddress(tokenB, "tokenB", false);
17395
+ if (normalizedTokenA === normalizedTokenB) throw new RangeError("ERC20 pair tokens must be different");
17396
+ return BigInt(normalizedTokenA) < BigInt(normalizedTokenB) ? {
17397
+ token0: normalizedTokenA,
17398
+ token1: normalizedTokenB
17399
+ } : {
17400
+ token0: normalizedTokenB,
17401
+ token1: normalizedTokenA
17402
+ };
17403
+ }
17404
+ /**
17405
+ * Validates, checksums, and sorts two distinct EVM currencies. The zero
17406
+ * address is allowed and, when present, necessarily sorts as currency0.
17407
+ */
17408
+ function sortEvmCurrencyPair(currencyA, currencyB) {
17409
+ const normalizedCurrencyA = checksumAddress(currencyA, "currencyA", true);
17410
+ const normalizedCurrencyB = checksumAddress(currencyB, "currencyB", true);
17411
+ if (normalizedCurrencyA === normalizedCurrencyB) throw new RangeError("EVM pair currencies must be different");
17412
+ return BigInt(normalizedCurrencyA) < BigInt(normalizedCurrencyB) ? {
17413
+ currency0: normalizedCurrencyA,
17414
+ currency1: normalizedCurrencyB
17415
+ } : {
17416
+ currency0: normalizedCurrencyB,
17417
+ currency1: normalizedCurrencyA
17418
+ };
17419
+ }
17420
+ /**
17421
+ * Returns floor(sqrt(value)) using bigint arithmetic only.
17422
+ */
17423
+ function integerSqrt(value) {
17424
+ if (typeof value !== "bigint") throw new TypeError("Square-root input must be a bigint");
17425
+ if (value < 0n) throw new RangeError("Square-root input must not be negative");
17426
+ if (value < 2n) return value;
17427
+ let estimate = value;
17428
+ let nextEstimate = estimate + 1n >> 1n;
17429
+ while (nextEstimate < estimate) {
17430
+ estimate = nextEstimate;
17431
+ nextEstimate = estimate + value / estimate >> 1n;
17432
+ }
17433
+ return estimate;
17434
+ }
17435
+ /**
17436
+ * Enforces the Uniswap TickMath interval: MIN is inclusive and MAX exclusive.
17437
+ * Returns the input so it can be composed with transaction builders.
17438
+ */
17439
+ function validateSqrtPriceX96(sqrtPriceX96) {
17440
+ if (typeof sqrtPriceX96 !== "bigint") throw new TypeError("sqrtPriceX96 must be a bigint");
17441
+ if (sqrtPriceX96 < 4295128739n || sqrtPriceX96 >= 1461446703485210103287273052203988822378723970342n) throw new RangeError(`sqrtPriceX96 must be in [${MIN_SQRT_RATIO}, ${MAX_SQRT_RATIO})`);
17442
+ return sqrtPriceX96;
17443
+ }
17444
+ /**
17445
+ * Encode an exact raw token1/token0 amount ratio without token metadata.
17446
+ * The result matches the canonical V3 floor-rounding operation.
17447
+ */
17448
+ function encodeSqrtRatioX96(amount1Raw, amount0Raw) {
17449
+ if (typeof amount0Raw !== "bigint" || typeof amount1Raw !== "bigint") throw new TypeError("Raw ratio amounts must be bigint values");
17450
+ if (amount0Raw <= 0n || amount1Raw <= 0n) throw new RangeError("Raw ratio amounts must be greater than zero");
17451
+ return validateSqrtPriceX96(integerSqrt((amount1Raw << 192n) / amount0Raw));
17452
+ }
17453
+ /**
17454
+ * Converts an exact quote-per-base human price into the canonical raw-token
17455
+ * ratio and sqrtPriceX96 expected by concentrated-liquidity initializers.
17456
+ *
17457
+ * Address sorting and reciprocal orientation happen before the only lossy
17458
+ * operation. The final encoding is exactly:
17459
+ *
17460
+ * floor(sqrt((amount1Raw << 192) / amount0Raw))
17461
+ */
17462
+ function encodeInitialSqrtPriceX96(price) {
17463
+ const pair = sortErc20Pair(price.baseToken, price.quoteToken);
17464
+ const baseToken = checksumAddress(price.baseToken, "baseToken", false);
17465
+ assertErc20Decimals(price.baseTokenDecimals, "baseTokenDecimals");
17466
+ assertErc20Decimals(price.quoteTokenDecimals, "quoteTokenDecimals");
17467
+ assertPositiveFraction(price.quotePerBase);
17468
+ const baseScale = 10n ** BigInt(price.baseTokenDecimals);
17469
+ const quoteScale = 10n ** BigInt(price.quoteTokenDecimals);
17470
+ const baseTokenIsToken0 = baseToken === pair.token0;
17471
+ const amount0Raw = baseTokenIsToken0 ? price.quotePerBase.denominator * baseScale : price.quotePerBase.numerator * quoteScale;
17472
+ const amount1Raw = baseTokenIsToken0 ? price.quotePerBase.numerator * quoteScale : price.quotePerBase.denominator * baseScale;
17473
+ const sqrtPriceX96 = encodeSqrtRatioX96(amount1Raw, amount0Raw);
17474
+ return {
17475
+ ...pair,
17476
+ amount0Raw,
17477
+ amount1Raw,
17478
+ sqrtPriceX96,
17479
+ baseTokenIsToken0
17480
+ };
17481
+ }
17482
+ /**
17483
+ * Currency-aware counterpart to {@link encodeInitialSqrtPriceX96}. It keeps
17484
+ * the same exact orientation and floor-rounding rules while permitting the
17485
+ * native zero-address currency required by Uniswap V4.
17486
+ */
17487
+ function encodeCurrencyInitialSqrtPriceX96(price) {
17488
+ const pair = sortEvmCurrencyPair(price.baseCurrency, price.quoteCurrency);
17489
+ const baseCurrency = checksumAddress(price.baseCurrency, "baseCurrency", true);
17490
+ assertErc20Decimals(price.baseCurrencyDecimals, "baseCurrencyDecimals");
17491
+ assertErc20Decimals(price.quoteCurrencyDecimals, "quoteCurrencyDecimals");
17492
+ assertPositiveFraction(price.quotePerBase);
17493
+ const baseScale = 10n ** BigInt(price.baseCurrencyDecimals);
17494
+ const quoteScale = 10n ** BigInt(price.quoteCurrencyDecimals);
17495
+ const baseCurrencyIsCurrency0 = baseCurrency === pair.currency0;
17496
+ const amount0Raw = baseCurrencyIsCurrency0 ? price.quotePerBase.denominator * baseScale : price.quotePerBase.numerator * quoteScale;
17497
+ const amount1Raw = baseCurrencyIsCurrency0 ? price.quotePerBase.numerator * quoteScale : price.quotePerBase.denominator * baseScale;
17498
+ return {
17499
+ ...pair,
17500
+ amount0Raw,
17501
+ amount1Raw,
17502
+ sqrtPriceX96: encodeSqrtRatioX96(amount1Raw, amount0Raw),
17503
+ baseCurrencyIsCurrency0
17504
+ };
17505
+ }
17506
+ //#endregion
17507
+ //#region src/pool-lifecycle/errors.ts
17508
+ /** Error thrown when a pool lifecycle primitive cannot safely continue. */
17509
+ var PoolLifecycleError = class extends Error {
17510
+ constructor(code, message, causeValue) {
17511
+ super(message);
17512
+ this.name = "PoolLifecycleError";
17513
+ this.code = code;
17514
+ this.causeValue = causeValue;
17515
+ }
17516
+ };
17517
+ //#endregion
17518
+ //#region src/pool-lifecycle/v4/key.ts
17519
+ const V4_DYNAMIC_FEE_FLAG = 8388608;
17520
+ const V4_MAX_STATIC_FEE = 1e6;
17521
+ const V4_MAX_TICK_SPACING = 32767;
17522
+ const V4_ALL_HOOK_MASK = (1n << 14n) - 1n;
17523
+ const V4_ZERO_ADDRESS = getAddress("0x0000000000000000000000000000000000000000");
17524
+ const BEFORE_SWAP_FLAG = 1n << 7n;
17525
+ const AFTER_SWAP_FLAG = 1n << 6n;
17526
+ const AFTER_ADD_LIQUIDITY_FLAG = 1n << 10n;
17527
+ const AFTER_REMOVE_LIQUIDITY_FLAG = 1n << 8n;
17528
+ const BEFORE_SWAP_RETURNS_DELTA_FLAG = 1n << 3n;
17529
+ const AFTER_SWAP_RETURNS_DELTA_FLAG = 1n << 2n;
17530
+ const AFTER_ADD_LIQUIDITY_RETURNS_DELTA_FLAG = 1n << 1n;
17531
+ const AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG = 1n;
17532
+ const POOL_KEY_ABI_PARAMETER = {
17533
+ type: "tuple",
17534
+ components: [
17339
17535
  {
17340
- internalType: "int24",
17341
- name: "tick",
17342
- type: "int24"
17536
+ name: "currency0",
17537
+ type: "address"
17343
17538
  },
17344
17539
  {
17345
- internalType: "int24",
17346
- name: "prevInitializedTick",
17347
- type: "int24"
17540
+ name: "currency1",
17541
+ type: "address"
17348
17542
  },
17349
17543
  {
17350
- internalType: "uint16",
17351
17544
  name: "fee",
17352
- type: "uint16"
17353
- },
17354
- {
17355
- internalType: "uint16",
17356
- name: "timepointIndex",
17357
- type: "uint16"
17545
+ type: "uint24"
17358
17546
  },
17359
17547
  {
17360
- internalType: "uint8",
17361
- name: "communityFee",
17362
- type: "uint8"
17548
+ name: "tickSpacing",
17549
+ type: "int24"
17363
17550
  },
17364
17551
  {
17365
- internalType: "bool",
17366
- name: "unlocked",
17367
- type: "bool"
17552
+ name: "hooks",
17553
+ type: "address"
17368
17554
  }
17369
- ],
17370
- stateMutability: "view",
17371
- type: "function"
17372
- }];
17373
- const GLOBAL_STATE_ABI_INTEGRAL_V_1 = [{
17374
- inputs: [],
17375
- name: "globalState",
17376
- outputs: [
17377
- {
17378
- internalType: "uint160",
17379
- name: "price",
17380
- type: "uint160"
17555
+ ]
17556
+ };
17557
+ function invalidInput(message, cause) {
17558
+ throw new PoolLifecycleError("INVALID_INPUT", message, cause);
17559
+ }
17560
+ function normalizeAddress(value, label) {
17561
+ if (typeof value !== "string" || !isAddress(value, { strict: true })) return invalidInput(`${label} must be a valid EVM address.`);
17562
+ return getAddress(value);
17563
+ }
17564
+ function validateFee(fee) {
17565
+ if (!Number.isSafeInteger(fee) || Number(fee) < 0 || Number(fee) > 1e6 && Number(fee) !== 8388608) return invalidInput("V4 fee must be an integer from 0 through 1000000 or the dynamic fee flag 0x800000.");
17566
+ return Number(fee);
17567
+ }
17568
+ function validateTickSpacing(tickSpacing) {
17569
+ if (!Number.isSafeInteger(tickSpacing) || Number(tickSpacing) < 1 || Number(tickSpacing) > 32767) return invalidInput("V4 tickSpacing must be an integer from 1 through 32767.");
17570
+ return Number(tickSpacing);
17571
+ }
17572
+ function validateHookAddress(hooksAddress, fee) {
17573
+ const hooks = BigInt(hooksAddress);
17574
+ const hasFlag = (flag) => (hooks & flag) !== 0n;
17575
+ if (!hasFlag(BEFORE_SWAP_FLAG) && hasFlag(BEFORE_SWAP_RETURNS_DELTA_FLAG) || !hasFlag(AFTER_SWAP_FLAG) && hasFlag(AFTER_SWAP_RETURNS_DELTA_FLAG) || !hasFlag(AFTER_ADD_LIQUIDITY_FLAG) && hasFlag(AFTER_ADD_LIQUIDITY_RETURNS_DELTA_FLAG) || !hasFlag(AFTER_REMOVE_LIQUIDITY_FLAG) && hasFlag(AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)) invalidInput("V4 hook return-delta flags require their corresponding action flags.");
17576
+ const dynamicFee = fee === V4_DYNAMIC_FEE_FLAG;
17577
+ if (!(hooks === 0n ? !dynamicFee : (hooks & V4_ALL_HOOK_MASK) !== 0n || dynamicFee)) invalidInput("V4 hooks address is incompatible with its fee and permission flags.");
17578
+ }
17579
+ /** Validate a complete PoolKey whose currencies are already canonically ordered. */
17580
+ function validateV4PoolKey(value) {
17581
+ const currency0 = normalizeAddress(value?.currency0, "currency0");
17582
+ const currency1 = normalizeAddress(value?.currency1, "currency1");
17583
+ const fee = validateFee(value?.fee);
17584
+ const tickSpacing = validateTickSpacing(value?.tickSpacing);
17585
+ const hooks = normalizeAddress(value?.hooks, "hooks");
17586
+ if (BigInt(currency0) >= BigInt(currency1)) invalidInput("V4 currencies must be distinct and canonically ordered.");
17587
+ validateHookAddress(hooks, fee);
17588
+ return {
17589
+ currency0,
17590
+ currency1,
17591
+ fee,
17592
+ tickSpacing,
17593
+ hooks
17594
+ };
17595
+ }
17596
+ /**
17597
+ * Validate and sort two currencies. Address zero is deliberately accepted and
17598
+ * sorts first because V4 represents the native currency as address(0).
17599
+ */
17600
+ function canonicalizeV4PoolKey(value) {
17601
+ const currencyA = normalizeAddress(value?.currencyA, "currencyA");
17602
+ const currencyB = normalizeAddress(value?.currencyB, "currencyB");
17603
+ if (currencyA === currencyB) return invalidInput("V4 pool currencies must be different.");
17604
+ const [currency0, currency1] = BigInt(currencyA) < BigInt(currencyB) ? [currencyA, currencyB] : [currencyB, currencyA];
17605
+ return validateV4PoolKey({
17606
+ currency0,
17607
+ currency1,
17608
+ fee: value?.fee,
17609
+ tickSpacing: value?.tickSpacing,
17610
+ hooks: value?.hooks
17611
+ });
17612
+ }
17613
+ /** Return the exact PoolId used by PoolIdLibrary.toId. */
17614
+ function getV4PoolId(key) {
17615
+ const validated = validateV4PoolKey(key);
17616
+ return keccak256(encodeAbiParameters([POOL_KEY_ABI_PARAMETER], [validated]));
17617
+ }
17618
+ function v4PoolKeysEqual(left, right) {
17619
+ try {
17620
+ const a = validateV4PoolKey(left);
17621
+ const b = validateV4PoolKey(right);
17622
+ return a.currency0 === b.currency0 && a.currency1 === b.currency1 && a.fee === b.fee && a.tickSpacing === b.tickSpacing && a.hooks === b.hooks;
17623
+ } catch {
17624
+ return false;
17625
+ }
17626
+ }
17627
+ /** Validate price bounds and bind the price to the canonical PoolKey order. */
17628
+ function assertV4InitialPrice(key, value) {
17629
+ const currency0 = normalizeAddress(value?.currency0, "initialPrice.currency0");
17630
+ const currency1 = normalizeAddress(value?.currency1, "initialPrice.currency1");
17631
+ if (currency0 !== key.currency0 || currency1 !== key.currency1) return invalidInput("V4 initial price currencies must match the canonical PoolKey order.");
17632
+ try {
17633
+ return {
17634
+ currency0,
17635
+ currency1,
17636
+ sqrtPriceX96: validateSqrtPriceX96(value?.sqrtPriceX96)
17637
+ };
17638
+ } catch (error) {
17639
+ return invalidInput(error instanceof Error ? error.message : "V4 sqrtPriceX96 is invalid.", error);
17640
+ }
17641
+ }
17642
+ //#endregion
17643
+ //#region src/base/vault/utils.ts
17644
+ function asV4Uint24(value, label) {
17645
+ if (typeof value !== "number" && typeof value !== "bigint" || !Number.isSafeInteger(Number(value)) || Number(value) < 0 || Number(value) > 16777215) throw new Error(`V4 StateView returned an invalid ${label}.`);
17646
+ return Number(value);
17647
+ }
17648
+ /** Read a V4 PoolId through its configured StateView at one block. */
17649
+ async function getV4PoolState(publicClient, params) {
17650
+ if (!/^0x[0-9a-fA-F]{64}$/.test(params.poolId)) throw new Error("V4 poolId must be a bytes32 hex value.");
17651
+ const chain = chainIdToName(params.chainId);
17652
+ const config = getAmmConfig("")[Protocol.UniswapV4];
17653
+ const manager = chain && config?.PoolManager?.[chain];
17654
+ const view = chain && config?.StateView?.[chain];
17655
+ if (!manager || !view || !isAddress(manager) || !isAddress(view)) throw new Error(`Uniswap V4 PoolManager or StateView is missing for chain ${params.chainId}.`);
17656
+ const actualChainId = await publicClient.getChainId();
17657
+ if (actualChainId !== params.chainId) throw new Error(`Public client chain ${actualChainId} does not match V4 chain ${params.chainId}.`);
17658
+ const blockNumber = params.blockNumber ?? await publicClient.getBlockNumber();
17659
+ if (typeof blockNumber !== "bigint" || blockNumber < 0n) throw new Error("V4 blockNumber must be a non-negative bigint.");
17660
+ const stateView = getAddress(view);
17661
+ const [boundManager, slot0] = await Promise.all([publicClient.readContract({
17662
+ address: stateView,
17663
+ abi: v4StateViewAbi,
17664
+ functionName: "poolManager",
17665
+ blockNumber
17666
+ }), publicClient.readContract({
17667
+ address: stateView,
17668
+ abi: v4StateViewAbi,
17669
+ functionName: "getSlot0",
17670
+ args: [params.poolId],
17671
+ blockNumber
17672
+ })]);
17673
+ if (getAddress(boundManager) !== getAddress(manager)) throw new Error("Configured Uniswap V4 StateView is bound to a different PoolManager.");
17674
+ if (!Array.isArray(slot0) || slot0.length !== 4) throw new Error("V4 StateView returned malformed slot0 state.");
17675
+ const [sqrtPriceX96, rawTick, rawProtocolFee, rawLpFee] = slot0;
17676
+ if (typeof sqrtPriceX96 !== "bigint" || sqrtPriceX96 === 0n) throw new Error(sqrtPriceX96 === 0n ? "Uniswap V4 pool is not initialized." : "V4 StateView returned malformed sqrtPriceX96.");
17677
+ validateSqrtPriceX96(sqrtPriceX96);
17678
+ const tick = Number(rawTick);
17679
+ if (typeof rawTick !== "number" && typeof rawTick !== "bigint" || !Number.isSafeInteger(tick) || tick < -887272 || tick > 887272) throw new Error("V4 StateView returned an invalid tick.");
17680
+ const protocolFee = asV4Uint24(rawProtocolFee, "protocol fee");
17681
+ if (asV4Uint24(rawLpFee, "LP fee") > 1e6) throw new Error("V4 StateView returned an invalid LP fee.");
17682
+ return {
17683
+ sqrtPriceX96,
17684
+ tick,
17685
+ observationIndex: 0,
17686
+ observationCardinality: 0,
17687
+ observationCardinalityNext: 0,
17688
+ feeProtocol: protocolFee,
17689
+ unlocked: true
17690
+ };
17691
+ }
17692
+ const GLOBAL_STATE_ABI = [{
17693
+ inputs: [],
17694
+ name: "globalState",
17695
+ outputs: [
17696
+ {
17697
+ internalType: "uint160",
17698
+ name: "price",
17699
+ type: "uint160"
17700
+ },
17701
+ {
17702
+ internalType: "int24",
17703
+ name: "tick",
17704
+ type: "int24"
17705
+ },
17706
+ {
17707
+ internalType: "int24",
17708
+ name: "prevInitializedTick",
17709
+ type: "int24"
17710
+ },
17711
+ {
17712
+ internalType: "uint16",
17713
+ name: "fee",
17714
+ type: "uint16"
17715
+ },
17716
+ {
17717
+ internalType: "uint16",
17718
+ name: "timepointIndex",
17719
+ type: "uint16"
17720
+ },
17721
+ {
17722
+ internalType: "uint8",
17723
+ name: "communityFee",
17724
+ type: "uint8"
17725
+ },
17726
+ {
17727
+ internalType: "bool",
17728
+ name: "unlocked",
17729
+ type: "bool"
17730
+ }
17731
+ ],
17732
+ stateMutability: "view",
17733
+ type: "function"
17734
+ }];
17735
+ const GLOBAL_STATE_ABI_INTEGRAL_V_1 = [{
17736
+ inputs: [],
17737
+ name: "globalState",
17738
+ outputs: [
17739
+ {
17740
+ internalType: "uint160",
17741
+ name: "price",
17742
+ type: "uint160"
17381
17743
  },
17382
17744
  {
17383
17745
  internalType: "int24",
@@ -17964,10 +18326,23 @@ async function getGlobalStateAlgebraIntegral(publicClient, poolAddress, isDirect
17964
18326
  * poolAddress: '0x...',
17965
18327
  * isPoolSharkPool: true
17966
18328
  * });
18329
+ *
18330
+ * // For Uniswap V4, supply the pool ID and the expected chain explicitly.
18331
+ * const v4State = await getPoolState(publicClient, {
18332
+ * protocol: Protocol.UniswapV4,
18333
+ * poolId: '0x...',
18334
+ * chainId: 8453
18335
+ * });
17967
18336
  * ```
17968
18337
  */
17969
18338
  async function getPoolState(publicClient, params) {
17970
18339
  try {
18340
+ if (params.protocol === Protocol.UniswapV4) return {
18341
+ data: await getV4PoolState(publicClient, params),
18342
+ status: 200,
18343
+ success: true
18344
+ };
18345
+ if ("protocol" in params || !/^0x[0-9a-fA-F]{40}$/.test(params.poolAddress)) throw new Error("An address-based pool read requires a valid pool address and supported protocol.");
17971
18346
  let stateResponse;
17972
18347
  if (params.isAlgebraIntegralPool) stateResponse = await getGlobalStateAlgebraIntegral(publicClient, params.poolAddress, params.isAlgebraDirectionPool || false);
17973
18348
  else if (params.isPoolSharkPool) {
@@ -18076,7 +18451,7 @@ async function getPoolStateWithPrice(publicClient, params) {
18076
18451
  success: false,
18077
18452
  error: stateResponse.error || "Failed to get pool state"
18078
18453
  };
18079
- const price = getPoolPrice(stateResponse.data, params);
18454
+ const price = getPoolPrice(stateResponse.data, params.protocol === Protocol.UniswapV4 ? {} : params);
18080
18455
  return {
18081
18456
  data: {
18082
18457
  state: stateResponse.data,
@@ -19829,320 +20204,6 @@ var VaultWithdrawClient = class {
19829
20204
  }
19830
20205
  };
19831
20206
  //#endregion
19832
- //#region src/pool-lifecycle/abis/v4.ts
19833
- /** Minimal authoritative IPoolManager surface used by the V4 lifecycle adapter. */
19834
- const v4PoolManagerAbi = parseAbi(["function initialize((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) key, uint160 sqrtPriceX96) returns (int24 tick)", "event Initialize(bytes32 indexed id, address indexed currency0, address indexed currency1, uint24 fee, int24 tickSpacing, address hooks, uint160 sqrtPriceX96, int24 tick)"]);
19835
- /** Minimal StateView/ImmutableState surface used for deployment and state checks. */
19836
- const v4StateViewAbi = parseAbi(["function poolManager() view returns (address)", "function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)"]);
19837
- //#endregion
19838
- //#region src/pool-lifecycle/errors.ts
19839
- /** Error thrown when a pool lifecycle primitive cannot safely continue. */
19840
- var PoolLifecycleError = class extends Error {
19841
- constructor(code, message, causeValue) {
19842
- super(message);
19843
- this.name = "PoolLifecycleError";
19844
- this.code = code;
19845
- this.causeValue = causeValue;
19846
- }
19847
- };
19848
- //#endregion
19849
- //#region src/pool-lifecycle/math.ts
19850
- /** The smallest sqrt price accepted by Uniswap TickMath, inclusive. */
19851
- const MIN_SQRT_RATIO = 4295128739n;
19852
- /** The largest TickMath sqrt-price boundary, which is not itself valid. */
19853
- const MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342n;
19854
- const ZERO_ADDRESS$3 = "0x0000000000000000000000000000000000000000";
19855
- const MAX_ERC20_DECIMALS = 255;
19856
- function greatestCommonDivisor(a, b) {
19857
- let left = a;
19858
- let right = b;
19859
- while (right !== 0n) {
19860
- const remainder = left % right;
19861
- left = right;
19862
- right = remainder;
19863
- }
19864
- return left;
19865
- }
19866
- function checksumAddress(value, label, allowZero) {
19867
- if (typeof value !== "string" || !isAddress(value, { strict: true })) throw new TypeError(`${label} must be a valid EVM address`);
19868
- const address = getAddress(value);
19869
- if (!allowZero && address === ZERO_ADDRESS$3) throw new RangeError(`${label} must not be the zero address`);
19870
- return address;
19871
- }
19872
- function assertErc20Decimals(value, label) {
19873
- if (!Number.isSafeInteger(value) || value < 0 || value > MAX_ERC20_DECIMALS) throw new RangeError(`${label} must be an integer from 0 through 255`);
19874
- }
19875
- function assertPositiveFraction(value) {
19876
- if (typeof value?.numerator !== "bigint" || typeof value?.denominator !== "bigint") throw new TypeError("quotePerBase must contain bigint numerator and denominator values");
19877
- if (value.numerator <= 0n) throw new RangeError("quotePerBase numerator must be greater than zero");
19878
- if (value.denominator <= 0n) throw new RangeError("quotePerBase denominator must be greater than zero");
19879
- }
19880
- /**
19881
- * Parses an unsigned, fixed-point decimal string without converting through a
19882
- * JavaScript number. Signs, exponent notation, whitespace, and omitted whole
19883
- * or fractional digits are rejected. The returned fraction is reduced.
19884
- */
19885
- function parseExactDecimal(value) {
19886
- if (typeof value !== "string") throw new TypeError("Decimal value must be provided as a string");
19887
- const match = /^([0-9]+)(?:\.([0-9]+))?$/.exec(value);
19888
- if (match === null || match[0] !== value) throw new TypeError("Decimal value must use unsigned fixed-point notation, for example \"123.45\"");
19889
- const wholeDigits = match[1];
19890
- const fractionalDigits = match[2] ?? "";
19891
- const numerator = BigInt(`${wholeDigits}${fractionalDigits}`);
19892
- if (numerator === 0n) return {
19893
- numerator: 0n,
19894
- denominator: 1n
19895
- };
19896
- const denominator = 10n ** BigInt(fractionalDigits.length);
19897
- const divisor = greatestCommonDivisor(numerator, denominator);
19898
- return {
19899
- numerator: numerator / divisor,
19900
- denominator: denominator / divisor
19901
- };
19902
- }
19903
- /**
19904
- * Validates, checksums, and sorts two distinct non-zero ERC20 addresses.
19905
- */
19906
- function sortErc20Pair(tokenA, tokenB) {
19907
- const normalizedTokenA = checksumAddress(tokenA, "tokenA", false);
19908
- const normalizedTokenB = checksumAddress(tokenB, "tokenB", false);
19909
- if (normalizedTokenA === normalizedTokenB) throw new RangeError("ERC20 pair tokens must be different");
19910
- return BigInt(normalizedTokenA) < BigInt(normalizedTokenB) ? {
19911
- token0: normalizedTokenA,
19912
- token1: normalizedTokenB
19913
- } : {
19914
- token0: normalizedTokenB,
19915
- token1: normalizedTokenA
19916
- };
19917
- }
19918
- /**
19919
- * Validates, checksums, and sorts two distinct EVM currencies. The zero
19920
- * address is allowed and, when present, necessarily sorts as currency0.
19921
- */
19922
- function sortEvmCurrencyPair(currencyA, currencyB) {
19923
- const normalizedCurrencyA = checksumAddress(currencyA, "currencyA", true);
19924
- const normalizedCurrencyB = checksumAddress(currencyB, "currencyB", true);
19925
- if (normalizedCurrencyA === normalizedCurrencyB) throw new RangeError("EVM pair currencies must be different");
19926
- return BigInt(normalizedCurrencyA) < BigInt(normalizedCurrencyB) ? {
19927
- currency0: normalizedCurrencyA,
19928
- currency1: normalizedCurrencyB
19929
- } : {
19930
- currency0: normalizedCurrencyB,
19931
- currency1: normalizedCurrencyA
19932
- };
19933
- }
19934
- /**
19935
- * Returns floor(sqrt(value)) using bigint arithmetic only.
19936
- */
19937
- function integerSqrt(value) {
19938
- if (typeof value !== "bigint") throw new TypeError("Square-root input must be a bigint");
19939
- if (value < 0n) throw new RangeError("Square-root input must not be negative");
19940
- if (value < 2n) return value;
19941
- let estimate = value;
19942
- let nextEstimate = estimate + 1n >> 1n;
19943
- while (nextEstimate < estimate) {
19944
- estimate = nextEstimate;
19945
- nextEstimate = estimate + value / estimate >> 1n;
19946
- }
19947
- return estimate;
19948
- }
19949
- /**
19950
- * Enforces the Uniswap TickMath interval: MIN is inclusive and MAX exclusive.
19951
- * Returns the input so it can be composed with transaction builders.
19952
- */
19953
- function validateSqrtPriceX96(sqrtPriceX96) {
19954
- if (typeof sqrtPriceX96 !== "bigint") throw new TypeError("sqrtPriceX96 must be a bigint");
19955
- if (sqrtPriceX96 < 4295128739n || sqrtPriceX96 >= 1461446703485210103287273052203988822378723970342n) throw new RangeError(`sqrtPriceX96 must be in [${MIN_SQRT_RATIO}, ${MAX_SQRT_RATIO})`);
19956
- return sqrtPriceX96;
19957
- }
19958
- /**
19959
- * Encode an exact raw token1/token0 amount ratio without token metadata.
19960
- * The result matches the canonical V3 floor-rounding operation.
19961
- */
19962
- function encodeSqrtRatioX96(amount1Raw, amount0Raw) {
19963
- if (typeof amount0Raw !== "bigint" || typeof amount1Raw !== "bigint") throw new TypeError("Raw ratio amounts must be bigint values");
19964
- if (amount0Raw <= 0n || amount1Raw <= 0n) throw new RangeError("Raw ratio amounts must be greater than zero");
19965
- return validateSqrtPriceX96(integerSqrt((amount1Raw << 192n) / amount0Raw));
19966
- }
19967
- /**
19968
- * Converts an exact quote-per-base human price into the canonical raw-token
19969
- * ratio and sqrtPriceX96 expected by concentrated-liquidity initializers.
19970
- *
19971
- * Address sorting and reciprocal orientation happen before the only lossy
19972
- * operation. The final encoding is exactly:
19973
- *
19974
- * floor(sqrt((amount1Raw << 192) / amount0Raw))
19975
- */
19976
- function encodeInitialSqrtPriceX96(price) {
19977
- const pair = sortErc20Pair(price.baseToken, price.quoteToken);
19978
- const baseToken = checksumAddress(price.baseToken, "baseToken", false);
19979
- assertErc20Decimals(price.baseTokenDecimals, "baseTokenDecimals");
19980
- assertErc20Decimals(price.quoteTokenDecimals, "quoteTokenDecimals");
19981
- assertPositiveFraction(price.quotePerBase);
19982
- const baseScale = 10n ** BigInt(price.baseTokenDecimals);
19983
- const quoteScale = 10n ** BigInt(price.quoteTokenDecimals);
19984
- const baseTokenIsToken0 = baseToken === pair.token0;
19985
- const amount0Raw = baseTokenIsToken0 ? price.quotePerBase.denominator * baseScale : price.quotePerBase.numerator * quoteScale;
19986
- const amount1Raw = baseTokenIsToken0 ? price.quotePerBase.numerator * quoteScale : price.quotePerBase.denominator * baseScale;
19987
- const sqrtPriceX96 = encodeSqrtRatioX96(amount1Raw, amount0Raw);
19988
- return {
19989
- ...pair,
19990
- amount0Raw,
19991
- amount1Raw,
19992
- sqrtPriceX96,
19993
- baseTokenIsToken0
19994
- };
19995
- }
19996
- /**
19997
- * Currency-aware counterpart to {@link encodeInitialSqrtPriceX96}. It keeps
19998
- * the same exact orientation and floor-rounding rules while permitting the
19999
- * native zero-address currency required by Uniswap V4.
20000
- */
20001
- function encodeCurrencyInitialSqrtPriceX96(price) {
20002
- const pair = sortEvmCurrencyPair(price.baseCurrency, price.quoteCurrency);
20003
- const baseCurrency = checksumAddress(price.baseCurrency, "baseCurrency", true);
20004
- assertErc20Decimals(price.baseCurrencyDecimals, "baseCurrencyDecimals");
20005
- assertErc20Decimals(price.quoteCurrencyDecimals, "quoteCurrencyDecimals");
20006
- assertPositiveFraction(price.quotePerBase);
20007
- const baseScale = 10n ** BigInt(price.baseCurrencyDecimals);
20008
- const quoteScale = 10n ** BigInt(price.quoteCurrencyDecimals);
20009
- const baseCurrencyIsCurrency0 = baseCurrency === pair.currency0;
20010
- const amount0Raw = baseCurrencyIsCurrency0 ? price.quotePerBase.denominator * baseScale : price.quotePerBase.numerator * quoteScale;
20011
- const amount1Raw = baseCurrencyIsCurrency0 ? price.quotePerBase.numerator * quoteScale : price.quotePerBase.denominator * baseScale;
20012
- return {
20013
- ...pair,
20014
- amount0Raw,
20015
- amount1Raw,
20016
- sqrtPriceX96: encodeSqrtRatioX96(amount1Raw, amount0Raw),
20017
- baseCurrencyIsCurrency0
20018
- };
20019
- }
20020
- //#endregion
20021
- //#region src/pool-lifecycle/v4/key.ts
20022
- const V4_DYNAMIC_FEE_FLAG = 8388608;
20023
- const V4_MAX_STATIC_FEE = 1e6;
20024
- const V4_MAX_TICK_SPACING = 32767;
20025
- const V4_ALL_HOOK_MASK = (1n << 14n) - 1n;
20026
- const V4_ZERO_ADDRESS = getAddress("0x0000000000000000000000000000000000000000");
20027
- const BEFORE_SWAP_FLAG = 1n << 7n;
20028
- const AFTER_SWAP_FLAG = 1n << 6n;
20029
- const AFTER_ADD_LIQUIDITY_FLAG = 1n << 10n;
20030
- const AFTER_REMOVE_LIQUIDITY_FLAG = 1n << 8n;
20031
- const BEFORE_SWAP_RETURNS_DELTA_FLAG = 1n << 3n;
20032
- const AFTER_SWAP_RETURNS_DELTA_FLAG = 1n << 2n;
20033
- const AFTER_ADD_LIQUIDITY_RETURNS_DELTA_FLAG = 1n << 1n;
20034
- const AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG = 1n;
20035
- const POOL_KEY_ABI_PARAMETER = {
20036
- type: "tuple",
20037
- components: [
20038
- {
20039
- name: "currency0",
20040
- type: "address"
20041
- },
20042
- {
20043
- name: "currency1",
20044
- type: "address"
20045
- },
20046
- {
20047
- name: "fee",
20048
- type: "uint24"
20049
- },
20050
- {
20051
- name: "tickSpacing",
20052
- type: "int24"
20053
- },
20054
- {
20055
- name: "hooks",
20056
- type: "address"
20057
- }
20058
- ]
20059
- };
20060
- function invalidInput(message, cause) {
20061
- throw new PoolLifecycleError("INVALID_INPUT", message, cause);
20062
- }
20063
- function normalizeAddress(value, label) {
20064
- if (typeof value !== "string" || !isAddress(value, { strict: true })) return invalidInput(`${label} must be a valid EVM address.`);
20065
- return getAddress(value);
20066
- }
20067
- function validateFee(fee) {
20068
- if (!Number.isSafeInteger(fee) || Number(fee) < 0 || Number(fee) > 1e6 && Number(fee) !== 8388608) return invalidInput("V4 fee must be an integer from 0 through 1000000 or the dynamic fee flag 0x800000.");
20069
- return Number(fee);
20070
- }
20071
- function validateTickSpacing(tickSpacing) {
20072
- if (!Number.isSafeInteger(tickSpacing) || Number(tickSpacing) < 1 || Number(tickSpacing) > 32767) return invalidInput("V4 tickSpacing must be an integer from 1 through 32767.");
20073
- return Number(tickSpacing);
20074
- }
20075
- function validateHookAddress(hooksAddress, fee) {
20076
- const hooks = BigInt(hooksAddress);
20077
- const hasFlag = (flag) => (hooks & flag) !== 0n;
20078
- if (!hasFlag(BEFORE_SWAP_FLAG) && hasFlag(BEFORE_SWAP_RETURNS_DELTA_FLAG) || !hasFlag(AFTER_SWAP_FLAG) && hasFlag(AFTER_SWAP_RETURNS_DELTA_FLAG) || !hasFlag(AFTER_ADD_LIQUIDITY_FLAG) && hasFlag(AFTER_ADD_LIQUIDITY_RETURNS_DELTA_FLAG) || !hasFlag(AFTER_REMOVE_LIQUIDITY_FLAG) && hasFlag(AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)) invalidInput("V4 hook return-delta flags require their corresponding action flags.");
20079
- const dynamicFee = fee === V4_DYNAMIC_FEE_FLAG;
20080
- if (!(hooks === 0n ? !dynamicFee : (hooks & V4_ALL_HOOK_MASK) !== 0n || dynamicFee)) invalidInput("V4 hooks address is incompatible with its fee and permission flags.");
20081
- }
20082
- /** Validate a complete PoolKey whose currencies are already canonically ordered. */
20083
- function validateV4PoolKey(value) {
20084
- const currency0 = normalizeAddress(value?.currency0, "currency0");
20085
- const currency1 = normalizeAddress(value?.currency1, "currency1");
20086
- const fee = validateFee(value?.fee);
20087
- const tickSpacing = validateTickSpacing(value?.tickSpacing);
20088
- const hooks = normalizeAddress(value?.hooks, "hooks");
20089
- if (BigInt(currency0) >= BigInt(currency1)) invalidInput("V4 currencies must be distinct and canonically ordered.");
20090
- validateHookAddress(hooks, fee);
20091
- return {
20092
- currency0,
20093
- currency1,
20094
- fee,
20095
- tickSpacing,
20096
- hooks
20097
- };
20098
- }
20099
- /**
20100
- * Validate and sort two currencies. Address zero is deliberately accepted and
20101
- * sorts first because V4 represents the native currency as address(0).
20102
- */
20103
- function canonicalizeV4PoolKey(value) {
20104
- const currencyA = normalizeAddress(value?.currencyA, "currencyA");
20105
- const currencyB = normalizeAddress(value?.currencyB, "currencyB");
20106
- if (currencyA === currencyB) return invalidInput("V4 pool currencies must be different.");
20107
- const [currency0, currency1] = BigInt(currencyA) < BigInt(currencyB) ? [currencyA, currencyB] : [currencyB, currencyA];
20108
- return validateV4PoolKey({
20109
- currency0,
20110
- currency1,
20111
- fee: value?.fee,
20112
- tickSpacing: value?.tickSpacing,
20113
- hooks: value?.hooks
20114
- });
20115
- }
20116
- /** Return the exact PoolId used by PoolIdLibrary.toId. */
20117
- function getV4PoolId(key) {
20118
- const validated = validateV4PoolKey(key);
20119
- return keccak256(encodeAbiParameters([POOL_KEY_ABI_PARAMETER], [validated]));
20120
- }
20121
- function v4PoolKeysEqual(left, right) {
20122
- try {
20123
- const a = validateV4PoolKey(left);
20124
- const b = validateV4PoolKey(right);
20125
- return a.currency0 === b.currency0 && a.currency1 === b.currency1 && a.fee === b.fee && a.tickSpacing === b.tickSpacing && a.hooks === b.hooks;
20126
- } catch {
20127
- return false;
20128
- }
20129
- }
20130
- /** Validate price bounds and bind the price to the canonical PoolKey order. */
20131
- function assertV4InitialPrice(key, value) {
20132
- const currency0 = normalizeAddress(value?.currency0, "initialPrice.currency0");
20133
- const currency1 = normalizeAddress(value?.currency1, "initialPrice.currency1");
20134
- if (currency0 !== key.currency0 || currency1 !== key.currency1) return invalidInput("V4 initial price currencies must match the canonical PoolKey order.");
20135
- try {
20136
- return {
20137
- currency0,
20138
- currency1,
20139
- sqrtPriceX96: validateSqrtPriceX96(value?.sqrtPriceX96)
20140
- };
20141
- } catch (error) {
20142
- return invalidInput(error instanceof Error ? error.message : "V4 sqrtPriceX96 is invalid.", error);
20143
- }
20144
- }
20145
- //#endregion
20146
20207
  //#region src/base/vault/execution-context.ts
20147
20208
  const VAULT_REGISTRY_ABI = parseAbi(["function getVaultDetails(address vault) view returns ((uint8 state,uint256 tokenId,uint256 vaultID,string payloadIpfs,address vaultAddress,string beaconName) details)", "function beaconAddresses(string beaconName) view returns (address)"]);
20148
20209
  const VAULT_EXECUTION_ABI = parseAbi([
@@ -23012,7 +23073,6 @@ var PoolClient = class extends SubgraphClient {
23012
23073
  return data.data;
23013
23074
  };
23014
23075
  this.apiCallCount++;
23015
- console.log("Total API calls:", this.apiCallCount);
23016
23076
  const timeoutPromise = new Promise((_, reject) => {
23017
23077
  setTimeout(() => reject(/* @__PURE__ */ new Error("GraphQL query timeout")), this.defaultTimeout);
23018
23078
  });
@@ -28929,6 +28989,6 @@ async function verifyV4PoolAction(params) {
28929
28989
  * See {@link SmartRewards} for detailed API documentation.
28930
28990
  */
28931
28991
  //#endregion
28932
- export { AERODROME_BEACON_NAMES, AERODROME_PROTOCOLS, AERODROME_SLIPSTREAM_LIFECYCLE_DEPLOYMENTS, ALGEBRA_INTEGRAL_PROTOCOLS, ALGEBRA_INTEGRAL_V_2_0_PROTOCOLS, ALGEBRA_LIFECYCLE_DEPLOYMENTS, ALGEBRA_PROTOCOLS, AMMType, API_URLS, AerodromeBeacons, AlgebgraHookBeacons, CURRENT_V4_LIFECYCLE_DEPLOYMENTS, Chain, ChainId, DIRECTIONAL_ALGEBRA_PROTOCOLS, FEE_MANAGER_ABI, FeeManagerClient, MAX_SQRT_RATIO, MIN_SQRT_RATIO, MultiPositionManagers, POOLSHARK_PROTOCOLS, POOL_LIFECYCLE_DEPLOYMENTS, PREPARED_POOL_ACTION_SERIALIZATION_VERSION, PoolClient, PoolLifecycleError, Protocol, QuickSwapQuoterV2, QuoterV2AlgebgraIntegral, QuoterV2AlgebgraIntegral21, QuoterV2Factory, QuoterV2Shadow, QuoterV2Thick, SHADOW_PROTOCOLS, SingleAssetDepositClient, SmartRewards, StakingClient, StakingProtocol, SteerClient, StrykePositionManagers, SubgraphClient, SubgraphVaultClient, TEST_UNISWAP_JIT_HOOK_BEACON, UNISWAP_V4_BEACON_NAMES, UNISWAP_V4_HOOK_BEACON_NAMES, UNISWAP_V4_NO_ORACLE_BEACON, UniswapHookBeacons, UniswapV3PoolABI, UniswapV3QuoterABI, UniswapV4Beacons, V3_CONFIG_PROTOCOLS, V3_LIFECYCLE_DEPLOYMENTS, V4_ALL_HOOK_MASK, V4_DYNAMIC_FEE_FLAG, V4_LIFECYCLE_DEPLOYMENTS, V4_LIFECYCLE_DEPLOYMENTS_BY_ID, V4_MAX_STATIC_FEE, V4_MAX_TICK_SPACING, V4_ZERO_ADDRESS, VAULT_FEES_ABI, VaultClient, abis, aerodromeSlipstreamFactoryAbi, aerodromeSlipstreamPoolAbi, algebraCustomPoolEntryPointAbi, algebraDirectionalPoolStateAbi, algebraIntegralPairFactoryAbi, algebraIntegralPluginDataFactoryAbi, algebraIntegralPoolStateAbi, algebraLegacyPoolStateAbi, algebraPairFactoryAbi, algebraPoolBaseAbi, apechainAddresses, arbitrumAddresses, arbitrumgoerliAddresses, arcAddresses, arthswapConfig, assertAerodromeSlipstreamInitialPrice, assertAlgebraInitialPrice, assertLatestAerodromeSlipstreamLifecycleDeployment, assertPreparedV3PoolAction, assertPreparedV4PoolAction, assertV3InitialPrice, assertV4InitialPrice, astarAddresses, astarzkevmAddresses, avalancheAddresses, bartiotestAddresses, baseAddresses, baseSwapConfig, basexConfig, beraAddresses, bittensorAddresses, bittensorUniV3Config, blastAddresses, bscAddresses, buildAerodromeSlipstreamCreateAndInitializeTransaction, buildAlgebraCreatePoolTransaction, buildAlgebraInitializePoolTransaction, buildV3CreateAndInitializeTransaction, buildV3CreatePoolTransaction, buildV3InitializePoolTransaction, buildV4InitializePoolTransaction, calculateLimitPrice, calculateSwapAmount, camelotConfig, canonicalizeAerodromeSlipstreamPoolKey, canonicalizeAlgebraPoolKey, canonicalizeV3PoolKey, canonicalizeV4PoolKey, celoAddresses, chainIdToName, chainNameToId, crustConfig, decodeAerodromeSlipstreamPoolActionReceipt, decodeAlgebraPoolActionReceipt, decodeV3PoolActionReceipt, decodeV4PoolActionReceipt, deprecatedBundlesURL, deserializePreparedAerodromeSlipstreamPoolAction, deserializePreparedAlgebraPoolAction, deserializePreparedPoolAction, deserializePreparedV3PoolAction, deserializePreparedV4PoolAction, determineSwapDirection, encodeCurrencyInitialSqrtPriceX96, encodeInitialSqrtPriceX96, encodeSqrtRatioX96, equilibreConfig, erc1155Abi, erc20Abi, erc721Abi, estimateLpTokens, ethAddresses, evmosAddresses, fantomAddresses, fenixConfig, filecoinAddresses, flareAddresses, forgeConfig, fusionxConfig, getAmmConfig, getAmmConfigByChainId, getApiUrl, getBeaconNameByProtocol, getContractAddressByChainIdAndContractName, getExpectedParamType, getFactoryAddress, getInitCodeHash, getNFTManagerAddress, getNetworkByChainId, getPoolHelperByChainId, getPoolSlot0, getProtcolTypeByAmmType, getProtocolBySubgraph, getProtocolConfigByBeacon, getProtocolContractAddresses, getProtocolInfoByChainId, getProtocolInfoByName, getProtocolSubgraphURL, getProtocolTypeByBeacon, getProtocolsForChainId, getQuoterV2Address, getStabilityVaultsPeripheryAddress, getStabilityVaultsSubgraphUrl, getSubgraphUrlByChainId, getSupportedChainByChainId, getSupportedChainIds, getSupportedChains, getSwapRouterAddress, getTheGraphResolverUrl, getTickLensAddress, getUniswapV4BeaconSupportedChains, getV4LifecycleDeploymentId, getV4PoolId, getVaultExecutionContext, getVaultReserves, glyphConfig, goerliAddresses, hemiAddresses, henjinConfig, herculesConfig, horizaConfig, inspectAerodromeSlipstreamPool, inspectAlgebraCustomPoolEntryPoint, inspectAlgebraPool, inspectV3Pool, inspectV4Pool, integerSqrt, isAerodromeBeacon, isAerodromeVault, isAlgebraDirectionProtocol, isAlgebraIntegral21QuoteParams, isAlgebraIntegralProtocol, isAlgebraIntegralV2Protocol, isAlgebraProtocol, isAlgebraProtocolBySubgraph, isAlgebraQuoteParams, isPoolSharkProtocol, isShadowProtocol, isShadowQuoteParams, isSingleAssetDepositSupported, isThickQuoteParams, isThickV2Protocol, isUniswapQuoteParams, isUniswapV4Beacon, isUniswapV4BeaconAvailableOnChain, isUniswapV4HookBeacon, isValidStakingProtocol, katanaAddresses, katanaConfig, kavaAddresses, kimConfig, kinetixConfig, lineaAddresses, linehubConfig, localhostAddresses, lynexConfig, maiaConfig, mantaAddresses, mantleAddresses, metaVaultConfig, metisAddresses, modeAddresses, moonbeamAddresses, mumbaiAddresses, nestVaultConfig, networks, normalizeProtocol, novaswapConfig, okxtestnetAddresses, optimismAddresses, optimismgoerliAddresses, pancakeSwapConfig, parseExactDecimal, polygonAddresses, polyzkevmAddresses, poolsharkConfig, prepareAerodromeSlipstreamPool, prepareAlgebraPool, prepareLatestAerodromeSlipstreamPool, prepareV3CreateAndInitialize, prepareV3CreatePool, prepareV3InitializePool, prepareV4Initialize, quickSwapAlgebraConfig, quickSwapConfig, quickSwapIntegralConfig, quickSwapUniv3Config, resolveAerodromeSlipstreamLifecycleDeployment, resolveAlgebraLifecycleDeployment, resolveCurrentV4LifecycleDeployment, resolveLatestAerodromeSlipstreamLifecycleDeployment, resolvePoolLifecycleDeployment, resolveV3LifecycleDeployment, resolveV4LifecycleDeployment, resolveV4LifecycleDeploymentById, retroConfig, robinhoodAddresses, rootstockAddresses, sagaAddresses, scrollAddresses, seiAddresses, serializePreparedPoolAction, shadowConfig, shouldValidateUniswapV4VaultHook, simulateAerodromeSlipstreamPoolAction, simulateAlgebraPoolAction, simulateSwap, simulateV3PoolAction, simulateV4PoolAction, singleTokenDepositAbi, soneiumAddresses, sonicAddresses, sortErc20Pair, sortEvmCurrencyPair, spark32Config, sparkConfig, stabilityVaultsConfig, steerSubgraphConfig, supswapConfig, sushiConfig, swapmodeConfig, swapsicleConfig, taikoAddresses, telosAddresses, thenaConfig, thickConfig, thrusterConfig, thundercoreAddresses, uniAddresses, uniswapConfig, v3FactoryAbi, v3PoolAbi, v3PoolInitializerAbi, v4PoolKeysEqual, v4PoolManagerAbi, v4StateViewAbi, validateAerodromeSlipstreamLifecycleDeployment, validateAlgebraLifecycleDeployment, validatePreparedAerodromeSlipstreamPoolAction, validatePreparedAlgebraPoolAction, validatePreparedV3PoolAction, validatePreparedV4PoolAction, validateQuoteParams, validateSqrtPriceX96, validateSwapParams, validateV4LifecycleDeployment, validateV4PoolKey, verifyAerodromeSlipstreamPoolAction, verifyAlgebraPoolAction, verifyV3PoolAction, verifyV4PoolAction, xlayerAddresses, zetaAddresses, zircuitAddresses };
28992
+ export { AERODROME_BEACON_NAMES, AERODROME_PROTOCOLS, AERODROME_SLIPSTREAM_LIFECYCLE_DEPLOYMENTS, ALGEBRA_INTEGRAL_PROTOCOLS, ALGEBRA_INTEGRAL_V_2_0_PROTOCOLS, ALGEBRA_LIFECYCLE_DEPLOYMENTS, ALGEBRA_PROTOCOLS, AMMType, API_URLS, AerodromeBeacons, AlgebgraHookBeacons, CURRENT_V4_LIFECYCLE_DEPLOYMENTS, Chain, ChainId, DIRECTIONAL_ALGEBRA_PROTOCOLS, FEE_MANAGER_ABI, FeeManagerClient, MAX_SQRT_RATIO, MIN_SQRT_RATIO, MultiPositionManagers, POOLSHARK_PROTOCOLS, POOL_LIFECYCLE_DEPLOYMENTS, PREPARED_POOL_ACTION_SERIALIZATION_VERSION, PoolClient, PoolLifecycleError, Protocol, QuickSwapQuoterV2, QuoterV2AlgebgraIntegral, QuoterV2AlgebgraIntegral21, QuoterV2Factory, QuoterV2Shadow, QuoterV2Thick, SHADOW_PROTOCOLS, SingleAssetDepositClient, SmartRewards, StakingClient, StakingProtocol, SteerClient, StrykePositionManagers, SubgraphClient, SubgraphVaultClient, TEST_UNISWAP_JIT_HOOK_BEACON, UNISWAP_V4_BEACON_NAMES, UNISWAP_V4_HOOK_BEACON_NAMES, UNISWAP_V4_NO_ORACLE_BEACON, UniswapHookBeacons, UniswapV3PoolABI, UniswapV3QuoterABI, UniswapV4Beacons, V3_CONFIG_PROTOCOLS, V3_LIFECYCLE_DEPLOYMENTS, V4_ALL_HOOK_MASK, V4_DYNAMIC_FEE_FLAG, V4_LIFECYCLE_DEPLOYMENTS, V4_LIFECYCLE_DEPLOYMENTS_BY_ID, V4_MAX_STATIC_FEE, V4_MAX_TICK_SPACING, V4_ZERO_ADDRESS, VAULT_FEES_ABI, VaultClient, abis, aerodromeSlipstreamFactoryAbi, aerodromeSlipstreamPoolAbi, algebraCustomPoolEntryPointAbi, algebraDirectionalPoolStateAbi, algebraIntegralPairFactoryAbi, algebraIntegralPluginDataFactoryAbi, algebraIntegralPoolStateAbi, algebraLegacyPoolStateAbi, algebraPairFactoryAbi, algebraPoolBaseAbi, apechainAddresses, arbitrumAddresses, arbitrumgoerliAddresses, arcAddresses, arthswapConfig, assertAerodromeSlipstreamInitialPrice, assertAlgebraInitialPrice, assertLatestAerodromeSlipstreamLifecycleDeployment, assertPreparedV3PoolAction, assertPreparedV4PoolAction, assertV3InitialPrice, assertV4InitialPrice, astarAddresses, astarzkevmAddresses, avalancheAddresses, bartiotestAddresses, baseAddresses, baseSwapConfig, basexConfig, beraAddresses, bittensorAddresses, bittensorUniV3Config, blastAddresses, bscAddresses, buildAerodromeSlipstreamCreateAndInitializeTransaction, buildAlgebraCreatePoolTransaction, buildAlgebraInitializePoolTransaction, buildV3CreateAndInitializeTransaction, buildV3CreatePoolTransaction, buildV3InitializePoolTransaction, buildV4InitializePoolTransaction, calculateLimitPrice, calculateSwapAmount, camelotConfig, canonicalizeAerodromeSlipstreamPoolKey, canonicalizeAlgebraPoolKey, canonicalizeV3PoolKey, canonicalizeV4PoolKey, celoAddresses, chainIdToName, chainNameToId, crustConfig, decodeAerodromeSlipstreamPoolActionReceipt, decodeAlgebraPoolActionReceipt, decodeV3PoolActionReceipt, decodeV4PoolActionReceipt, deprecatedBundlesURL, deserializePreparedAerodromeSlipstreamPoolAction, deserializePreparedAlgebraPoolAction, deserializePreparedPoolAction, deserializePreparedV3PoolAction, deserializePreparedV4PoolAction, determineSwapDirection, encodeCurrencyInitialSqrtPriceX96, encodeInitialSqrtPriceX96, encodeSqrtRatioX96, equilibreConfig, erc1155Abi, erc20Abi, erc721Abi, estimateLpTokens, ethAddresses, evmosAddresses, fantomAddresses, fenixConfig, filecoinAddresses, flareAddresses, forgeConfig, fusionxConfig, getAmmConfig, getAmmConfigByChainId, getApiUrl, getBeaconNameByProtocol, getContractAddressByChainIdAndContractName, getExpectedParamType, getFactoryAddress, getInitCodeHash, getNFTManagerAddress, getNetworkByChainId, getPoolHelperByChainId, getPoolSlot0, getPoolState, getPoolStateWithPrice, getProtcolTypeByAmmType, getProtocolBySubgraph, getProtocolConfigByBeacon, getProtocolContractAddresses, getProtocolInfoByChainId, getProtocolInfoByName, getProtocolSubgraphURL, getProtocolTypeByBeacon, getProtocolsForChainId, getQuoterV2Address, getStabilityVaultsPeripheryAddress, getStabilityVaultsSubgraphUrl, getSubgraphUrlByChainId, getSupportedChainByChainId, getSupportedChainIds, getSupportedChains, getSwapRouterAddress, getTheGraphResolverUrl, getTickLensAddress, getUniswapV4BeaconSupportedChains, getV4LifecycleDeploymentId, getV4PoolId, getVaultExecutionContext, getVaultReserves, glyphConfig, goerliAddresses, hemiAddresses, henjinConfig, herculesConfig, horizaConfig, inspectAerodromeSlipstreamPool, inspectAlgebraCustomPoolEntryPoint, inspectAlgebraPool, inspectV3Pool, inspectV4Pool, integerSqrt, isAerodromeBeacon, isAerodromeVault, isAlgebraDirectionProtocol, isAlgebraIntegral21QuoteParams, isAlgebraIntegralProtocol, isAlgebraIntegralV2Protocol, isAlgebraProtocol, isAlgebraProtocolBySubgraph, isAlgebraQuoteParams, isPoolSharkProtocol, isShadowProtocol, isShadowQuoteParams, isSingleAssetDepositSupported, isThickQuoteParams, isThickV2Protocol, isUniswapQuoteParams, isUniswapV4Beacon, isUniswapV4BeaconAvailableOnChain, isUniswapV4HookBeacon, isValidStakingProtocol, katanaAddresses, katanaConfig, kavaAddresses, kimConfig, kinetixConfig, lineaAddresses, linehubConfig, localhostAddresses, lynexConfig, maiaConfig, mantaAddresses, mantleAddresses, metaVaultConfig, metisAddresses, modeAddresses, moonbeamAddresses, mumbaiAddresses, nestVaultConfig, networks, normalizeProtocol, novaswapConfig, okxtestnetAddresses, optimismAddresses, optimismgoerliAddresses, pancakeSwapConfig, parseExactDecimal, polygonAddresses, polyzkevmAddresses, poolsharkConfig, prepareAerodromeSlipstreamPool, prepareAlgebraPool, prepareLatestAerodromeSlipstreamPool, prepareV3CreateAndInitialize, prepareV3CreatePool, prepareV3InitializePool, prepareV4Initialize, quickSwapAlgebraConfig, quickSwapConfig, quickSwapIntegralConfig, quickSwapUniv3Config, resolveAerodromeSlipstreamLifecycleDeployment, resolveAlgebraLifecycleDeployment, resolveCurrentV4LifecycleDeployment, resolveLatestAerodromeSlipstreamLifecycleDeployment, resolvePoolLifecycleDeployment, resolveV3LifecycleDeployment, resolveV4LifecycleDeployment, resolveV4LifecycleDeploymentById, retroConfig, robinhoodAddresses, rootstockAddresses, sagaAddresses, scrollAddresses, seiAddresses, serializePreparedPoolAction, shadowConfig, shouldValidateUniswapV4VaultHook, simulateAerodromeSlipstreamPoolAction, simulateAlgebraPoolAction, simulateSwap, simulateV3PoolAction, simulateV4PoolAction, singleTokenDepositAbi, soneiumAddresses, sonicAddresses, sortErc20Pair, sortEvmCurrencyPair, spark32Config, sparkConfig, stabilityVaultsConfig, steerSubgraphConfig, supswapConfig, sushiConfig, swapmodeConfig, swapsicleConfig, taikoAddresses, telosAddresses, thenaConfig, thickConfig, thrusterConfig, thundercoreAddresses, uniAddresses, uniswapConfig, v3FactoryAbi, v3PoolAbi, v3PoolInitializerAbi, v4PoolKeysEqual, v4PoolManagerAbi, v4StateViewAbi, validateAerodromeSlipstreamLifecycleDeployment, validateAlgebraLifecycleDeployment, validatePreparedAerodromeSlipstreamPoolAction, validatePreparedAlgebraPoolAction, validatePreparedV3PoolAction, validatePreparedV4PoolAction, validateQuoteParams, validateSqrtPriceX96, validateSwapParams, validateV4LifecycleDeployment, validateV4PoolKey, verifyAerodromeSlipstreamPoolAction, verifyAlgebraPoolAction, verifyV3PoolAction, verifyV4PoolAction, xlayerAddresses, zetaAddresses, zircuitAddresses };
28933
28993
 
28934
28994
  //# sourceMappingURL=index.mjs.map