@hammerock/cca-sdk 0.1.0

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.cjs ADDED
@@ -0,0 +1,998 @@
1
+ 'use strict';
2
+
3
+ var viem = require('viem');
4
+ var chains = require('viem/chains');
5
+
6
+ // src/abis/auction.ts
7
+ var auctionAbi = [{ "type": "constructor", "inputs": [{ "name": "_token", "type": "address", "internalType": "address" }, { "name": "_totalSupply", "type": "uint128", "internalType": "uint128" }, { "name": "_parameters", "type": "tuple", "internalType": "struct AuctionParameters", "components": [{ "name": "currency", "type": "address", "internalType": "address" }, { "name": "tokensRecipient", "type": "address", "internalType": "address" }, { "name": "fundsRecipient", "type": "address", "internalType": "address" }, { "name": "startBlock", "type": "uint64", "internalType": "uint64" }, { "name": "endBlock", "type": "uint64", "internalType": "uint64" }, { "name": "claimBlock", "type": "uint64", "internalType": "uint64" }, { "name": "tickSpacing", "type": "uint256", "internalType": "uint256" }, { "name": "validationHook", "type": "address", "internalType": "address" }, { "name": "floorPrice", "type": "uint256", "internalType": "uint256" }, { "name": "requiredCurrencyRaised", "type": "uint128", "internalType": "uint128" }, { "name": "auctionStepsData", "type": "bytes", "internalType": "bytes" }] }], "stateMutability": "nonpayable" }, { "type": "function", "name": "MAX_BID_PRICE", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "MAX_BLOCK_NUMBER", "inputs": [], "outputs": [{ "name": "", "type": "uint64", "internalType": "uint64" }], "stateMutability": "view" }, { "type": "function", "name": "MAX_TICK_PTR", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "bids", "inputs": [{ "name": "bidId", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "tuple", "internalType": "struct Bid", "components": [{ "name": "startBlock", "type": "uint64", "internalType": "uint64" }, { "name": "startCumulativeMps", "type": "uint24", "internalType": "uint24" }, { "name": "exitedBlock", "type": "uint64", "internalType": "uint64" }, { "name": "maxPrice", "type": "uint256", "internalType": "uint256" }, { "name": "owner", "type": "address", "internalType": "address" }, { "name": "amountQ96", "type": "uint256", "internalType": "uint256" }, { "name": "tokensFilled", "type": "uint256", "internalType": "uint256" }] }], "stateMutability": "view" }, { "type": "function", "name": "checkpoint", "inputs": [], "outputs": [{ "name": "", "type": "tuple", "internalType": "struct Checkpoint", "components": [{ "name": "clearingPrice", "type": "uint256", "internalType": "uint256" }, { "name": "currencyRaisedAtClearingPriceQ96_X7", "type": "uint256", "internalType": "ValueX7" }, { "name": "cumulativeMpsPerPrice", "type": "uint256", "internalType": "uint256" }, { "name": "cumulativeMps", "type": "uint24", "internalType": "uint24" }, { "name": "prev", "type": "uint64", "internalType": "uint64" }, { "name": "next", "type": "uint64", "internalType": "uint64" }] }], "stateMutability": "nonpayable" }, { "type": "function", "name": "checkpoints", "inputs": [{ "name": "blockNumber", "type": "uint64", "internalType": "uint64" }], "outputs": [{ "name": "", "type": "tuple", "internalType": "struct Checkpoint", "components": [{ "name": "clearingPrice", "type": "uint256", "internalType": "uint256" }, { "name": "currencyRaisedAtClearingPriceQ96_X7", "type": "uint256", "internalType": "ValueX7" }, { "name": "cumulativeMpsPerPrice", "type": "uint256", "internalType": "uint256" }, { "name": "cumulativeMps", "type": "uint24", "internalType": "uint24" }, { "name": "prev", "type": "uint64", "internalType": "uint64" }, { "name": "next", "type": "uint64", "internalType": "uint64" }] }], "stateMutability": "view" }, { "type": "function", "name": "claimBlock", "inputs": [], "outputs": [{ "name": "", "type": "uint64", "internalType": "uint64" }], "stateMutability": "view" }, { "type": "function", "name": "claimTokens", "inputs": [{ "name": "_bidId", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "claimTokensBatch", "inputs": [{ "name": "_owner", "type": "address", "internalType": "address" }, { "name": "_bidIds", "type": "uint256[]", "internalType": "uint256[]" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "clearingPrice", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "currency", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "currencyRaised", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "currencyRaisedQ96_X7", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "ValueX7" }], "stateMutability": "view" }, { "type": "function", "name": "endBlock", "inputs": [], "outputs": [{ "name": "", "type": "uint64", "internalType": "uint64" }], "stateMutability": "view" }, { "type": "function", "name": "exitBid", "inputs": [{ "name": "_bidId", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "exitPartiallyFilledBid", "inputs": [{ "name": "_bidId", "type": "uint256", "internalType": "uint256" }, { "name": "_lastFullyFilledCheckpointBlock", "type": "uint64", "internalType": "uint64" }, { "name": "_outbidBlock", "type": "uint64", "internalType": "uint64" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "floorPrice", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "forceIterateOverTicks", "inputs": [{ "name": "_untilTickPrice", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "fundsRecipient", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "isGraduated", "inputs": [], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "lastCheckpointedBlock", "inputs": [], "outputs": [{ "name": "", "type": "uint64", "internalType": "uint64" }], "stateMutability": "view" }, { "type": "function", "name": "latestCheckpoint", "inputs": [], "outputs": [{ "name": "", "type": "tuple", "internalType": "struct Checkpoint", "components": [{ "name": "clearingPrice", "type": "uint256", "internalType": "uint256" }, { "name": "currencyRaisedAtClearingPriceQ96_X7", "type": "uint256", "internalType": "ValueX7" }, { "name": "cumulativeMpsPerPrice", "type": "uint256", "internalType": "uint256" }, { "name": "cumulativeMps", "type": "uint24", "internalType": "uint24" }, { "name": "prev", "type": "uint64", "internalType": "uint64" }, { "name": "next", "type": "uint64", "internalType": "uint64" }] }], "stateMutability": "view" }, { "type": "function", "name": "lbpInitializationParams", "inputs": [], "outputs": [{ "name": "params", "type": "tuple", "internalType": "struct LBPInitializationParams", "components": [{ "name": "initialPriceX96", "type": "uint256", "internalType": "uint256" }, { "name": "tokensSold", "type": "uint256", "internalType": "uint256" }, { "name": "currencyRaised", "type": "uint256", "internalType": "uint256" }] }], "stateMutability": "view" }, { "type": "function", "name": "nextActiveTickPrice", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "nextBidId", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "onTokensReceived", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "pointer", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "startBlock", "inputs": [], "outputs": [{ "name": "", "type": "uint64", "internalType": "uint64" }], "stateMutability": "view" }, { "type": "function", "name": "step", "inputs": [], "outputs": [{ "name": "", "type": "tuple", "internalType": "struct AuctionStep", "components": [{ "name": "mps", "type": "uint24", "internalType": "uint24" }, { "name": "startBlock", "type": "uint64", "internalType": "uint64" }, { "name": "endBlock", "type": "uint64", "internalType": "uint64" }] }], "stateMutability": "view" }, { "type": "function", "name": "submitBid", "inputs": [{ "name": "_maxPrice", "type": "uint256", "internalType": "uint256" }, { "name": "_amount", "type": "uint128", "internalType": "uint128" }, { "name": "_owner", "type": "address", "internalType": "address" }, { "name": "_hookData", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "payable" }, { "type": "function", "name": "submitBid", "inputs": [{ "name": "_maxPrice", "type": "uint256", "internalType": "uint256" }, { "name": "_amount", "type": "uint128", "internalType": "uint128" }, { "name": "_owner", "type": "address", "internalType": "address" }, { "name": "_prevTickPrice", "type": "uint256", "internalType": "uint256" }, { "name": "_hookData", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "payable" }, { "type": "function", "name": "sumCurrencyDemandAboveClearingQ96", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "supportsInterface", "inputs": [{ "name": "interfaceId", "type": "bytes4", "internalType": "bytes4" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "pure" }, { "type": "function", "name": "sweepCurrency", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "sweepCurrencyBlock", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "sweepUnsoldTokens", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "sweepUnsoldTokensBlock", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "tickSpacing", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ticks", "inputs": [{ "name": "price", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "tuple", "internalType": "struct Tick", "components": [{ "name": "next", "type": "uint256", "internalType": "uint256" }, { "name": "currencyDemandQ96", "type": "uint256", "internalType": "uint256" }] }], "stateMutability": "view" }, { "type": "function", "name": "token", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "tokensRecipient", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "totalCleared", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "totalClearedQ96_X7", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "ValueX7" }], "stateMutability": "view" }, { "type": "function", "name": "totalSupply", "inputs": [], "outputs": [{ "name": "", "type": "uint128", "internalType": "uint128" }], "stateMutability": "view" }, { "type": "function", "name": "validationHook", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "contract IValidationHook" }], "stateMutability": "view" }, { "type": "event", "name": "AuctionStepRecorded", "inputs": [{ "name": "startBlock", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "endBlock", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "mps", "type": "uint24", "indexed": false, "internalType": "uint24" }], "anonymous": false }, { "type": "event", "name": "BidExited", "inputs": [{ "name": "bidId", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "owner", "type": "address", "indexed": true, "internalType": "address" }, { "name": "tokensFilled", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "currencyRefunded", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "BidSubmitted", "inputs": [{ "name": "id", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "owner", "type": "address", "indexed": true, "internalType": "address" }, { "name": "price", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint128", "indexed": false, "internalType": "uint128" }], "anonymous": false }, { "type": "event", "name": "CheckpointUpdated", "inputs": [{ "name": "blockNumber", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "clearingPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "cumulativeMps", "type": "uint24", "indexed": false, "internalType": "uint24" }], "anonymous": false }, { "type": "event", "name": "ClearingPriceUpdated", "inputs": [{ "name": "blockNumber", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "clearingPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "CurrencySwept", "inputs": [{ "name": "fundsRecipient", "type": "address", "indexed": true, "internalType": "address" }, { "name": "currencyAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "NextActiveTickUpdated", "inputs": [{ "name": "price", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "TickInitialized", "inputs": [{ "name": "price", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "TokensClaimed", "inputs": [{ "name": "bidId", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "owner", "type": "address", "indexed": true, "internalType": "address" }, { "name": "tokensFilled", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "TokensReceived", "inputs": [{ "name": "totalSupply", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "TokensSwept", "inputs": [{ "name": "tokensRecipient", "type": "address", "indexed": true, "internalType": "address" }, { "name": "tokensAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "error", "name": "AuctionIsNotFinalized", "inputs": [] }, { "type": "error", "name": "AuctionIsNotOver", "inputs": [] }, { "type": "error", "name": "AuctionIsOver", "inputs": [] }, { "type": "error", "name": "AuctionNotStarted", "inputs": [] }, { "type": "error", "name": "AuctionSoldOut", "inputs": [] }, { "type": "error", "name": "BatchClaimDifferentOwner", "inputs": [{ "name": "expectedOwner", "type": "address", "internalType": "address" }, { "name": "receivedOwner", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "BidAlreadyExited", "inputs": [] }, { "type": "error", "name": "BidAmountTooSmall", "inputs": [] }, { "type": "error", "name": "BidIdDoesNotExist", "inputs": [{ "name": "bidId", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "BidMustBeAboveClearingPrice", "inputs": [] }, { "type": "error", "name": "BidNotExited", "inputs": [] }, { "type": "error", "name": "BidOwnerCannotBeZeroAddress", "inputs": [] }, { "type": "error", "name": "CannotExitBid", "inputs": [] }, { "type": "error", "name": "CannotPartiallyExitBidBeforeEndBlock", "inputs": [] }, { "type": "error", "name": "CannotPartiallyExitBidBeforeGraduation", "inputs": [] }, { "type": "error", "name": "CannotSweepCurrency", "inputs": [] }, { "type": "error", "name": "CannotSweepTokens", "inputs": [] }, { "type": "error", "name": "CannotUpdateUninitializedTick", "inputs": [] }, { "type": "error", "name": "CheckpointBlockNotIncreasing", "inputs": [] }, { "type": "error", "name": "ClaimBlockIsBeforeEndBlock", "inputs": [] }, { "type": "error", "name": "CurrencyIsNotNative", "inputs": [] }, { "type": "error", "name": "ERC20TransferFailed", "inputs": [] }, { "type": "error", "name": "FloorPriceAndTickSpacingGreaterThanMaxBidPrice", "inputs": [{ "name": "nextTick", "type": "uint256", "internalType": "uint256" }, { "name": "maxBidPrice", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "FloorPriceAndTickSpacingTooLarge", "inputs": [] }, { "type": "error", "name": "FloorPriceIsZero", "inputs": [] }, { "type": "error", "name": "FloorPriceTooLow", "inputs": [] }, { "type": "error", "name": "FundsRecipientIsZero", "inputs": [] }, { "type": "error", "name": "InvalidAmount", "inputs": [] }, { "type": "error", "name": "InvalidAuctionDataLength", "inputs": [] }, { "type": "error", "name": "InvalidBidPriceTooHigh", "inputs": [{ "name": "maxPrice", "type": "uint256", "internalType": "uint256" }, { "name": "maxBidPrice", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "InvalidBidUnableToClear", "inputs": [] }, { "type": "error", "name": "InvalidEndBlock", "inputs": [] }, { "type": "error", "name": "InvalidEndBlockGivenStepData", "inputs": [{ "name": "actualEndBlock", "type": "uint64", "internalType": "uint64" }, { "name": "expectedEndBlock", "type": "uint64", "internalType": "uint64" }] }, { "type": "error", "name": "InvalidLastFullyFilledCheckpointHint", "inputs": [] }, { "type": "error", "name": "InvalidOutbidBlockCheckpointHint", "inputs": [] }, { "type": "error", "name": "InvalidStepDataMps", "inputs": [{ "name": "actualMps", "type": "uint256", "internalType": "uint256" }, { "name": "expectedMps", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "InvalidTickPrice", "inputs": [] }, { "type": "error", "name": "InvalidTokenAmountReceived", "inputs": [] }, { "type": "error", "name": "MpsRemainingIsZero", "inputs": [] }, { "type": "error", "name": "NativeTransferFailed", "inputs": [] }, { "type": "error", "name": "NotClaimable", "inputs": [] }, { "type": "error", "name": "NotGraduated", "inputs": [] }, { "type": "error", "name": "Reentrancy", "inputs": [] }, { "type": "error", "name": "StepBlockDeltaCannotBeZero", "inputs": [] }, { "type": "error", "name": "StepLib__InvalidOffsetNotAtStepBoundary", "inputs": [] }, { "type": "error", "name": "StepLib__InvalidOffsetTooLarge", "inputs": [] }, { "type": "error", "name": "TickHintMustBeGreaterThanNextActiveTickPrice", "inputs": [{ "name": "tickPrice", "type": "uint256", "internalType": "uint256" }, { "name": "nextActiveTickPrice", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "TickNotInitialized", "inputs": [] }, { "type": "error", "name": "TickPreviousPriceInvalid", "inputs": [] }, { "type": "error", "name": "TickPriceNotAtBoundary", "inputs": [] }, { "type": "error", "name": "TickPriceNotIncreasing", "inputs": [] }, { "type": "error", "name": "TickSpacingTooSmall", "inputs": [] }, { "type": "error", "name": "TokenAndCurrencyCannotBeTheSame", "inputs": [] }, { "type": "error", "name": "TokenIsAddressZero", "inputs": [] }, { "type": "error", "name": "TokenTransferFailed", "inputs": [] }, { "type": "error", "name": "TokensNotReceived", "inputs": [] }, { "type": "error", "name": "TokensRecipientIsZero", "inputs": [] }, { "type": "error", "name": "TotalSupplyIsTooLarge", "inputs": [] }, { "type": "error", "name": "TotalSupplyIsZero", "inputs": [] }, { "type": "error", "name": "ValidationHookCallFailed", "inputs": [{ "name": "reason", "type": "bytes", "internalType": "bytes" }] }];
8
+
9
+ // src/abis/factory.ts
10
+ var factoryAbi = [{ "type": "function", "name": "getAuctionAddress", "inputs": [{ "name": "token", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }, { "name": "configData", "type": "bytes", "internalType": "bytes" }, { "name": "salt", "type": "bytes32", "internalType": "bytes32" }, { "name": "sender", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "initializeDistribution", "inputs": [{ "name": "token", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }, { "name": "configData", "type": "bytes", "internalType": "bytes" }, { "name": "salt", "type": "bytes32", "internalType": "bytes32" }], "outputs": [{ "name": "distributionContract", "type": "address", "internalType": "contract IDistributionContract" }], "stateMutability": "nonpayable" }, { "type": "event", "name": "AuctionCreated", "inputs": [{ "name": "auction", "type": "address", "indexed": true, "internalType": "address" }, { "name": "token", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "configData", "type": "bytes", "indexed": false, "internalType": "bytes" }], "anonymous": false }, { "type": "error", "name": "InvalidTokenAmount", "inputs": [{ "name": "amount", "type": "uint256", "internalType": "uint256" }] }];
11
+
12
+ // src/abis/auctionStateLens.ts
13
+ var auctionStateLensAbi = [{ "type": "function", "name": "revertWithState", "inputs": [{ "name": "auction", "type": "address", "internalType": "contract IContinuousClearingAuction" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "state", "inputs": [{ "name": "auction", "type": "address", "internalType": "contract IContinuousClearingAuction" }], "outputs": [{ "name": "", "type": "tuple", "internalType": "struct AuctionState", "components": [{ "name": "checkpoint", "type": "tuple", "internalType": "struct Checkpoint", "components": [{ "name": "clearingPrice", "type": "uint256", "internalType": "uint256" }, { "name": "currencyRaisedAtClearingPriceQ96_X7", "type": "uint256", "internalType": "ValueX7" }, { "name": "cumulativeMpsPerPrice", "type": "uint256", "internalType": "uint256" }, { "name": "cumulativeMps", "type": "uint24", "internalType": "uint24" }, { "name": "prev", "type": "uint64", "internalType": "uint64" }, { "name": "next", "type": "uint64", "internalType": "uint64" }] }, { "name": "currencyRaised", "type": "uint256", "internalType": "uint256" }, { "name": "totalCleared", "type": "uint256", "internalType": "uint256" }, { "name": "isGraduated", "type": "bool", "internalType": "bool" }] }], "stateMutability": "nonpayable" }, { "type": "error", "name": "CheckpointFailed", "inputs": [] }, { "type": "error", "name": "InvalidRevertReasonLength", "inputs": [] }];
14
+ var auctionStateLensDeployedBytecode = "0x608060405234801561000f575f80fd5b5060043610610034575f3560e01c806321a13d371461003857806331e658a51461004d575b5f80fd5b61004b61004636600461048a565b610076565b005b61006061005b36600461048a565b6102c7565b60405161006d91906104bd565b60405180910390f35b8073ffffffffffffffffffffffffffffffffffffffff1663c2c4c5c16040518163ffffffff1660e01b815260040160c0604051808303815f875af19250505080156100fc575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526100f991810190610620565b60015b610132576040517fd027b09000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60405180608001604052808381526020018473ffffffffffffffffffffffffffffffffffffffff1663998ba4fc6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561018d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101b1919061063a565b81526020018473ffffffffffffffffffffffffffffffffffffffff16633e9d91746040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101ff573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610223919061063a565b81526020018473ffffffffffffffffffffffffffffffffffffffff16639e5f26026040518163ffffffff1660e01b8152600401602060405180830381865afa158015610271573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102959190610660565b151581525090505f816040516020016102ae91906104bd565b6040516020818303038152906040529050805160208201fd5b60408051610140810182525f6080820181815260a0830182905260c0830182905260e083018290526101008301829052610120830182905282526020820181905291810182905260608101919091526040517f21a13d3700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8316600482015230906321a13d37906024015f604051808303815f87803b15801561037a575f80fd5b505af192505050801561038b575060015b6103ce573d8080156103b8576040519150601f19603f3d011682016040523d82523d5f602084013e6103bd565b606091505b506103c7816103d3565b9392505050565b919050565b60408051610140810182525f6080820181815260a0830182905260c0830182905260e083018290526101008301829052610120830182905282526020820181905291810182905260608101919091528151610120146104705760208251111561043e57815160208301fd5b6040517fa75357f900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b818060200190518101906104849190610679565b92915050565b5f6020828403121561049a575f80fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146103c7575f80fd5b5f61012082019050825180518352602081015160208401526040810151604084015262ffffff606082015116606084015267ffffffffffffffff608082015116608084015267ffffffffffffffff60a08201511660a084015250602083015160c0830152604083015160e0830152606083015161053f61010084018215159052565b5092915050565b60405160c0810167ffffffffffffffff8111828210171561058e577f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405290565b805167ffffffffffffffff811681146103ce575f80fd5b5f60c082840312156105bb575f80fd5b6105c3610546565b825181526020808401519082015260408084015190820152606083015190915062ffffff811681146105f3575f80fd5b606082015261060460808301610594565b608082015261061560a08301610594565b60a082015292915050565b5f60c08284031215610630575f80fd5b6103c783836105ab565b5f6020828403121561064a575f80fd5b5051919050565b805180151581146103ce575f80fd5b5f60208284031215610670575f80fd5b6103c782610651565b5f61012082840312801561068b575f80fd5b506040516080810167ffffffffffffffff811182821017156106d4577f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040526106e184846105ab565b815260c0830151602082015260e083015160408201526107046101008401610651565b6060820152939250505056fea164736f6c634300081a000a";
15
+
16
+ // src/abis/index.ts
17
+ var UPSTREAM_TAG = "v1.1.0";
18
+ var UPSTREAM_COMMIT = "a0aabaa45d8677a4944fc04d5dea2c4b499b3d3a";
19
+
20
+ // src/q96.ts
21
+ var Q96 = 2n ** 96n;
22
+ var MPS = 10000000n;
23
+ var X7 = MPS;
24
+ var DECIMAL_PATTERN = /^-?\d+(\.\d+)?$/;
25
+ function q96ToDecimalString(valueQ96, precision = 18, trimTrailingZeros = true) {
26
+ if (precision < 0 || !Number.isInteger(precision)) {
27
+ throw new TypeError(
28
+ `q96ToDecimalString: precision must be a non-negative integer, got ${precision}`
29
+ );
30
+ }
31
+ const negative = valueQ96 < 0n;
32
+ const magnitude = negative ? -valueQ96 : valueQ96;
33
+ const whole = magnitude / Q96;
34
+ const remainder = magnitude % Q96;
35
+ if (precision === 0) {
36
+ return `${negative && whole !== 0n ? "-" : ""}${whole}`;
37
+ }
38
+ const scale = 10n ** BigInt(precision);
39
+ const fractional = remainder * scale / Q96;
40
+ let fractionalDigits = fractional.toString().padStart(precision, "0");
41
+ if (trimTrailingZeros) {
42
+ fractionalDigits = fractionalDigits.replace(/0+$/, "");
43
+ }
44
+ const sign = negative && (whole !== 0n || fractional !== 0n) ? "-" : "";
45
+ return fractionalDigits.length > 0 ? `${sign}${whole}.${fractionalDigits}` : `${sign}${whole}`;
46
+ }
47
+ function q96ToNumber(valueQ96) {
48
+ return Number(q96ToDecimalString(valueQ96, 20, false));
49
+ }
50
+ function decimalToQ96(decimal) {
51
+ const asString = typeof decimal === "number" ? numberToDecimalString(decimal) : decimal.trim();
52
+ if (!DECIMAL_PATTERN.test(asString)) {
53
+ throw new TypeError(`decimalToQ96: expected a decimal string, got "${decimal}"`);
54
+ }
55
+ const negative = asString.startsWith("-");
56
+ const unsigned = negative ? asString.slice(1) : asString;
57
+ const [wholePart = "0", fractionalPart = ""] = unsigned.split(".");
58
+ const scale = 10n ** BigInt(fractionalPart.length);
59
+ const scaledValue = BigInt(wholePart) * scale + (fractionalPart === "" ? 0n : BigInt(fractionalPart));
60
+ const result = scaledValue * Q96 / scale;
61
+ return negative ? -result : result;
62
+ }
63
+ function numberToDecimalString(value) {
64
+ if (!Number.isFinite(value)) {
65
+ throw new TypeError(`decimalToQ96: expected a finite number, got ${value}`);
66
+ }
67
+ return value.toLocaleString("en-US", { useGrouping: false, maximumFractionDigits: 20 });
68
+ }
69
+ function formatQ96(valueQ96, significantDigits = 6) {
70
+ if (valueQ96 === 0n) return "0";
71
+ const negative = valueQ96 < 0n;
72
+ const magnitude = negative ? -valueQ96 : valueQ96;
73
+ const sign = negative ? "-" : "";
74
+ let precision;
75
+ if (magnitude / Q96 > 0n) {
76
+ precision = significantDigits;
77
+ } else {
78
+ const fractional = q96ToDecimalString(magnitude, 40, false).split(".")[1] ?? "";
79
+ const firstSignificant = fractional.search(/[1-9]/);
80
+ if (firstSignificant === -1) return "0";
81
+ precision = firstSignificant + significantDigits;
82
+ }
83
+ const scale = 10n ** BigInt(precision);
84
+ const rounded = (magnitude * scale * 2n + Q96) / (Q96 * 2n);
85
+ const wholePart = rounded / scale;
86
+ const fractionalPart = (rounded % scale).toString().padStart(precision, "0").replace(/0+$/, "");
87
+ return fractionalPart.length > 0 ? `${sign}${wholePart}.${fractionalPart}` : `${sign}${wholePart}`;
88
+ }
89
+ function mpsToFraction(cumulativeMps) {
90
+ return Number(BigInt(cumulativeMps)) / Number(MPS);
91
+ }
92
+ function formatMpsPercent(cumulativeMps, fractionDigits = 2) {
93
+ return (mpsToFraction(cumulativeMps) * 100).toFixed(fractionDigits);
94
+ }
95
+ function fromValueX7(valueX7) {
96
+ return valueX7 / X7;
97
+ }
98
+ function formatQ96Compact(valueQ96, significantDigits = 6) {
99
+ if (valueQ96 === 0n) return "0";
100
+ const negative = valueQ96 < 0n;
101
+ const magnitude = negative ? -valueQ96 : valueQ96;
102
+ const sign = negative ? "-" : "";
103
+ const plain = formatQ96(magnitude, significantDigits);
104
+ const [integerPart = "0", fractionalPart = ""] = plain.split(".");
105
+ if (integerPart !== "0") return `${sign}${plain}`;
106
+ const firstSignificant = fractionalPart.search(/[1-9]/);
107
+ if (firstSignificant === -1) return "0";
108
+ if (firstSignificant < 6) return `${sign}${plain}`;
109
+ const digits = fractionalPart.slice(firstSignificant).replace(/0+$/, "");
110
+ const exponent = -(firstSignificant + 1);
111
+ const mantissa = digits.length > 1 ? `${digits[0]}.${digits.slice(1)}` : digits;
112
+ return `${sign}${mantissa}e${exponent}`;
113
+ }
114
+
115
+ // src/auctionParameters.ts
116
+ var MIN_FLOOR_PRICE = 4294967296n;
117
+ var MIN_TICK_SPACING = 2n;
118
+ var UINT24_MAX = 16777215;
119
+ var UINT40_MAX = 1099511627775;
120
+ var AuctionParametersError = class extends Error {
121
+ };
122
+ function packAuctionSteps(steps) {
123
+ if (steps.length === 0) {
124
+ throw new AuctionParametersError("auctionStepsData cannot be empty (InvalidAuctionDataLength).");
125
+ }
126
+ let packed = "";
127
+ for (const step of steps) {
128
+ if (!Number.isInteger(step.mps) || step.mps < 0 || step.mps > UINT24_MAX) {
129
+ throw new AuctionParametersError(`step mps ${step.mps} does not fit uint24.`);
130
+ }
131
+ if (!Number.isInteger(step.blockDelta) || step.blockDelta <= 0) {
132
+ throw new AuctionParametersError(`step blockDelta must be > 0, got ${step.blockDelta}.`);
133
+ }
134
+ if (step.blockDelta > UINT40_MAX) {
135
+ throw new AuctionParametersError(`step blockDelta ${step.blockDelta} does not fit uint40.`);
136
+ }
137
+ packed += step.mps.toString(16).padStart(6, "0");
138
+ packed += step.blockDelta.toString(16).padStart(10, "0");
139
+ }
140
+ return `0x${packed}`;
141
+ }
142
+ function unpackAuctionSteps(data) {
143
+ const body = data.slice(2);
144
+ if (body.length === 0 || body.length % 16 !== 0) {
145
+ throw new AuctionParametersError(
146
+ `auctionStepsData must be a whole number of 8-byte steps, got ${body.length / 2} bytes.`
147
+ );
148
+ }
149
+ const steps = [];
150
+ for (let i = 0; i < body.length; i += 16) {
151
+ steps.push({
152
+ mps: Number.parseInt(body.slice(i, i + 6), 16),
153
+ blockDelta: Number.parseInt(body.slice(i + 6, i + 16), 16)
154
+ });
155
+ }
156
+ return steps;
157
+ }
158
+ function buildAuctionSteps(durationBlocks) {
159
+ if (!Number.isInteger(durationBlocks) || durationBlocks < 2) {
160
+ throw new AuctionParametersError(`durationBlocks must be an integer >= 2, got ${durationBlocks}.`);
161
+ }
162
+ const total = Number(MPS);
163
+ const perBlock = Math.floor(total / durationBlocks);
164
+ if (perBlock <= 0) {
165
+ throw new AuctionParametersError(
166
+ `durationBlocks ${durationBlocks} is longer than MPS (${total}) allows - each block would release 0.`
167
+ );
168
+ }
169
+ const remainder = total - perBlock * durationBlocks;
170
+ const finalBlockMps = perBlock + remainder;
171
+ if (finalBlockMps > UINT24_MAX) {
172
+ throw new AuctionParametersError(`final step mps ${finalBlockMps} does not fit uint24.`);
173
+ }
174
+ return durationBlocks === 1 ? [{ mps: total, blockDelta: 1 }] : [
175
+ { mps: perBlock, blockDelta: durationBlocks - 1 },
176
+ { mps: finalBlockMps, blockDelta: 1 }
177
+ ];
178
+ }
179
+ function totalMps(steps) {
180
+ return steps.reduce((sum, step) => sum + BigInt(step.mps) * BigInt(step.blockDelta), 0n);
181
+ }
182
+ function totalBlocks(steps) {
183
+ return steps.reduce((sum, step) => sum + BigInt(step.blockDelta), 0n);
184
+ }
185
+ function validateAuctionParameters(params) {
186
+ if (params.startBlock >= params.endBlock) {
187
+ throw new AuctionParametersError(
188
+ `startBlock (${params.startBlock}) must be < endBlock (${params.endBlock}) - InvalidEndBlock.`
189
+ );
190
+ }
191
+ if (params.claimBlock < params.endBlock) {
192
+ throw new AuctionParametersError(
193
+ `claimBlock (${params.claimBlock}) must be >= endBlock (${params.endBlock}) - ClaimBlockIsBeforeEndBlock.`
194
+ );
195
+ }
196
+ if (params.tickSpacing < MIN_TICK_SPACING) {
197
+ throw new AuctionParametersError(
198
+ `tickSpacing (${params.tickSpacing}) must be >= ${MIN_TICK_SPACING} - TickSpacingTooSmall.`
199
+ );
200
+ }
201
+ if (params.floorPriceQ96 === 0n) {
202
+ throw new AuctionParametersError("floorPrice cannot be zero - FloorPriceIsZero.");
203
+ }
204
+ if (params.floorPriceQ96 < MIN_FLOOR_PRICE) {
205
+ throw new AuctionParametersError(
206
+ `floorPrice (${params.floorPriceQ96}) must be >= ${MIN_FLOOR_PRICE} - FloorPriceTooLow.`
207
+ );
208
+ }
209
+ if (params.floorPriceQ96 % params.tickSpacing !== 0n) {
210
+ throw new AuctionParametersError(
211
+ `floorPrice (${params.floorPriceQ96}) must be a multiple of tickSpacing (${params.tickSpacing}) - TickPriceNotAtBoundary.`
212
+ );
213
+ }
214
+ const steps = unpackAuctionSteps(params.auctionStepsData);
215
+ const mpsSum = totalMps(steps);
216
+ if (mpsSum !== MPS) {
217
+ throw new AuctionParametersError(
218
+ `supply schedule releases ${mpsSum} mps, must be exactly ${MPS} - InvalidStepDataMps.`
219
+ );
220
+ }
221
+ const blockSum = totalBlocks(steps);
222
+ if (params.startBlock + blockSum !== params.endBlock) {
223
+ throw new AuctionParametersError(
224
+ `supply schedule spans ${blockSum} blocks, so it ends at ${params.startBlock + blockSum}, but endBlock is ${params.endBlock} - InvalidEndBlockGivenStepData.`
225
+ );
226
+ }
227
+ }
228
+ var PARAMETERS_TUPLE = viem.parseAbiParameters(
229
+ "(address currency, address tokensRecipient, address fundsRecipient, uint64 startBlock, uint64 endBlock, uint64 claimBlock, uint256 tickSpacing, address validationHook, uint256 floorPrice, uint128 requiredCurrencyRaised, bytes auctionStepsData)"
230
+ );
231
+ function encodeAuctionParameters(params) {
232
+ validateAuctionParameters(params);
233
+ return viem.encodeAbiParameters(PARAMETERS_TUPLE, [
234
+ {
235
+ currency: params.currency,
236
+ tokensRecipient: params.tokensRecipient,
237
+ fundsRecipient: params.fundsRecipient,
238
+ startBlock: params.startBlock,
239
+ endBlock: params.endBlock,
240
+ claimBlock: params.claimBlock,
241
+ tickSpacing: params.tickSpacing,
242
+ validationHook: params.validationHook,
243
+ floorPrice: params.floorPriceQ96,
244
+ requiredCurrencyRaised: params.requiredCurrencyRaised,
245
+ auctionStepsData: params.auctionStepsData
246
+ }
247
+ ]);
248
+ }
249
+ function decodeAuctionParameters(configData) {
250
+ const [decoded] = viem.decodeAbiParameters(PARAMETERS_TUPLE, configData);
251
+ const value = decoded;
252
+ return {
253
+ currency: value.currency,
254
+ tokensRecipient: value.tokensRecipient,
255
+ fundsRecipient: value.fundsRecipient,
256
+ startBlock: BigInt(value.startBlock),
257
+ endBlock: BigInt(value.endBlock),
258
+ claimBlock: BigInt(value.claimBlock),
259
+ tickSpacing: value.tickSpacing,
260
+ validationHook: value.validationHook,
261
+ floorPriceQ96: value.floorPrice,
262
+ requiredCurrencyRaised: value.requiredCurrencyRaised,
263
+ auctionStepsData: value.auctionStepsData
264
+ };
265
+ }
266
+ var FACTORY_ADDRESS = "0xCCccCcCAE7503Cac057829BF2811De42E16e0bD5";
267
+ var FACTORY_DEPLOY_BLOCK = {
268
+ [chains.sepolia.id]: 10130119n
269
+ };
270
+ var SUPPORTED_CHAINS = {
271
+ [chains.sepolia.id]: chains.sepolia,
272
+ [chains.baseSepolia.id]: chains.baseSepolia,
273
+ [chains.unichainSepolia.id]: chains.unichainSepolia
274
+ };
275
+ var BLOCK_TIME_SECONDS = {
276
+ [chains.sepolia.id]: 12,
277
+ [chains.baseSepolia.id]: 2,
278
+ [chains.unichainSepolia.id]: 1
279
+ };
280
+ var DEFAULT_LOG_CHUNK_SIZE = 50000n;
281
+ var NATIVE_CURRENCY = "0x0000000000000000000000000000000000000000";
282
+ var PERMIT2_ADDRESS = "0x000000000022D473030F116dDEE9F6B43aC78BA3";
283
+
284
+ // src/client.ts
285
+ function assertSupportedChain(chainId) {
286
+ const chain = SUPPORTED_CHAINS[chainId];
287
+ if (!chain) {
288
+ const supported = Object.values(SUPPORTED_CHAINS).map((c) => `${c.name} (${c.id})`).join(", ");
289
+ throw new Error(
290
+ `Beacon is testnet-only and refuses to run against chain id ${chainId}. Supported: ${supported}.`
291
+ );
292
+ }
293
+ return chain;
294
+ }
295
+ function createBeaconClient(config) {
296
+ const chain = assertSupportedChain(config.chainId);
297
+ const publicClient = viem.createPublicClient({
298
+ chain,
299
+ transport: viem.http(config.rpcUrl),
300
+ // Batch eagerly: reads fan out across many auctions in the directory.
301
+ batch: { multicall: true }
302
+ });
303
+ const logsClient = config.logsRpcUrl && config.logsRpcUrl !== config.rpcUrl ? viem.createPublicClient({ chain, transport: viem.http(config.logsRpcUrl) }) : publicClient;
304
+ const factoryDeployBlock = config.factoryDeployBlock ?? FACTORY_DEPLOY_BLOCK[config.chainId];
305
+ if (factoryDeployBlock === void 0) {
306
+ throw new Error(
307
+ `No known factory deploy block for chain id ${config.chainId}. Pass \`factoryDeployBlock\` explicitly so discovery knows where to start scanning.`
308
+ );
309
+ }
310
+ return {
311
+ publicClient,
312
+ logsClient,
313
+ chain,
314
+ chainId: config.chainId,
315
+ factoryAddress: config.factoryAddress ?? FACTORY_ADDRESS,
316
+ lensAddress: config.lensAddress,
317
+ factoryDeployBlock,
318
+ blockTimeSeconds: BLOCK_TIME_SECONDS[config.chainId] ?? 12
319
+ };
320
+ }
321
+ async function assertChainMatches(client) {
322
+ const actual = await client.publicClient.getChainId();
323
+ if (actual !== client.chainId) {
324
+ throw new Error(
325
+ `RPC chain id mismatch: configured for ${client.chainId} (${client.chain.name}) but the endpoint reports ${actual}. Check BEACON_RPC_URL.`
326
+ );
327
+ }
328
+ }
329
+ var auctionCreatedEvent = viem.getAbiItem({ abi: factoryAbi, name: "AuctionCreated" });
330
+ function toDiscoveredAuction(log) {
331
+ const { auction, token, amount, configData } = log.args;
332
+ if (!auction || !token) {
333
+ throw new Error(`Malformed AuctionCreated log in block ${log.blockNumber}: missing auction/token`);
334
+ }
335
+ return {
336
+ auction,
337
+ token,
338
+ amount: amount ?? 0n,
339
+ configData: configData ?? "0x",
340
+ blockNumber: log.blockNumber,
341
+ transactionHash: log.transactionHash,
342
+ logIndex: log.logIndex
343
+ };
344
+ }
345
+ async function scanAuctions(client, options = {}) {
346
+ const headBlock = options.toBlock ?? await client.publicClient.getBlockNumber();
347
+ const startBlock = options.fromBlock ?? client.factoryDeployBlock;
348
+ const maxChunk = options.chunkSize ?? DEFAULT_LOG_CHUNK_SIZE;
349
+ if (startBlock > headBlock) return [];
350
+ const emptyChunkRetries = options.emptyChunkRetries ?? 2;
351
+ const found = [];
352
+ let cursor = startBlock;
353
+ let chunkSize = maxChunk;
354
+ while (cursor <= headBlock) {
355
+ const chunkEnd = min(cursor + chunkSize - 1n, headBlock);
356
+ const fetchChunk = async (from, to) => await client.logsClient.getLogs({
357
+ address: client.factoryAddress,
358
+ event: auctionCreatedEvent,
359
+ fromBlock: from,
360
+ toBlock: to
361
+ });
362
+ let logs;
363
+ try {
364
+ logs = await fetchChunk(cursor, chunkEnd);
365
+ for (let attempt = 0; logs.length === 0 && attempt < emptyChunkRetries; attempt++) {
366
+ const retry = await fetchChunk(cursor, chunkEnd);
367
+ if (retry.length > 0) {
368
+ options.onAnomaly?.({
369
+ fromBlock: cursor,
370
+ toBlock: chunkEnd,
371
+ recoveredLogs: retry.length
372
+ });
373
+ logs = retry;
374
+ }
375
+ }
376
+ } catch (error) {
377
+ if (chunkSize > 1n) {
378
+ chunkSize = chunkSize / 2n;
379
+ continue;
380
+ }
381
+ throw new Error(
382
+ `eth_getLogs failed for a single block (${cursor}) on ${client.chain.name}: ${error.message}`
383
+ );
384
+ }
385
+ for (const log of logs) found.push(toDiscoveredAuction(log));
386
+ options.onProgress?.({
387
+ fromBlock: cursor,
388
+ toBlock: chunkEnd,
389
+ scannedTo: chunkEnd,
390
+ headBlock,
391
+ found: found.length
392
+ });
393
+ cursor = chunkEnd + 1n;
394
+ if (chunkSize < maxChunk) chunkSize = min(chunkSize * 2n, maxChunk);
395
+ }
396
+ found.sort(
397
+ (a, b) => a.blockNumber === b.blockNumber ? a.logIndex - b.logIndex : a.blockNumber < b.blockNumber ? -1 : 1
398
+ );
399
+ return found;
400
+ }
401
+ function watchAuctions(client, onAuction, options = {}) {
402
+ return client.logsClient.watchEvent({
403
+ address: client.factoryAddress,
404
+ event: auctionCreatedEvent,
405
+ poll: true,
406
+ pollingInterval: options.pollingIntervalMs ?? 12e3,
407
+ onError: options.onError,
408
+ onLogs: (logs) => {
409
+ for (const log of logs) {
410
+ try {
411
+ onAuction(toDiscoveredAuction(log));
412
+ } catch (error) {
413
+ options.onError?.(error);
414
+ }
415
+ }
416
+ }
417
+ });
418
+ }
419
+ async function scanAuctionsForToken(client, token, options = {}) {
420
+ const all = await scanAuctions(client, options);
421
+ return all.filter((entry) => entry.token.toLowerCase() === token.toLowerCase());
422
+ }
423
+ function min(a, b) {
424
+ return a < b ? a : b;
425
+ }
426
+ var erc20MetadataAbi = [
427
+ { type: "function", name: "symbol", inputs: [], outputs: [{ type: "string" }], stateMutability: "view" },
428
+ { type: "function", name: "name", inputs: [], outputs: [{ type: "string" }], stateMutability: "view" },
429
+ { type: "function", name: "decimals", inputs: [], outputs: [{ type: "uint8" }], stateMutability: "view" }
430
+ ];
431
+ async function getTokenMetadata(client, address) {
432
+ if (address === NATIVE_CURRENCY) {
433
+ const native = client.chain.nativeCurrency;
434
+ return {
435
+ address,
436
+ symbol: native.symbol,
437
+ name: native.name,
438
+ decimals: native.decimals,
439
+ isNative: true
440
+ };
441
+ }
442
+ const contract = { address, abi: erc20MetadataAbi };
443
+ const [symbol, name, decimals] = await client.publicClient.multicall({
444
+ allowFailure: true,
445
+ contracts: [
446
+ { ...contract, functionName: "symbol" },
447
+ { ...contract, functionName: "name" },
448
+ { ...contract, functionName: "decimals" }
449
+ ]
450
+ });
451
+ return {
452
+ address,
453
+ symbol: symbol.status === "success" ? symbol.result : shortAddress(address),
454
+ name: name.status === "success" ? name.result : shortAddress(address),
455
+ // 18 is the overwhelmingly common default; better than refusing to render.
456
+ decimals: decimals.status === "success" ? Number(decimals.result) : 18,
457
+ isNative: false
458
+ };
459
+ }
460
+ async function getTokenMetadataBatch(client, addresses) {
461
+ const unique = [...new Set(addresses)];
462
+ const entries = await Promise.all(
463
+ unique.map(async (address) => [address, await getTokenMetadata(client, address)])
464
+ );
465
+ return new Map(entries);
466
+ }
467
+ function formatTokenAmount(amount, token, maxFractionDigits = 4) {
468
+ if (amount === 0n) return `0 ${token.symbol}`;
469
+ const negative = amount < 0n;
470
+ const whole = viem.formatUnits(negative ? -amount : amount, token.decimals);
471
+ const [integerPart = "0", fractionalPart = ""] = whole.split(".");
472
+ const grouped = BigInt(integerPart).toLocaleString("en-US");
473
+ let trimmed = fractionalPart.slice(0, maxFractionDigits).replace(/0+$/, "");
474
+ if (integerPart === "0" && trimmed.length === 0) {
475
+ const firstSignificant = fractionalPart.search(/[1-9]/);
476
+ if (firstSignificant !== -1) {
477
+ trimmed = fractionalPart.slice(0, firstSignificant + 4).replace(/0+$/, "");
478
+ }
479
+ }
480
+ const sign = negative ? "-" : "";
481
+ return trimmed.length > 0 ? `${sign}${grouped}.${trimmed} ${token.symbol}` : `${sign}${grouped} ${token.symbol}`;
482
+ }
483
+ function shortAddress(address) {
484
+ return `${address.slice(0, 6)}...${address.slice(-4)}`;
485
+ }
486
+
487
+ // src/privateKey.ts
488
+ var PrivateKeyFormatError = class extends Error {
489
+ };
490
+ function normalizePrivateKey(raw, envVarName) {
491
+ const trimmed = (raw ?? "").trim();
492
+ if (trimmed.length === 0) {
493
+ throw new PrivateKeyFormatError(`${envVarName} is not set.`);
494
+ }
495
+ const body = trimmed.startsWith("0x") || trimmed.startsWith("0X") ? trimmed.slice(2) : trimmed;
496
+ if (!/^[0-9a-fA-F]{64}$/.test(body)) {
497
+ throw new PrivateKeyFormatError(
498
+ `${envVarName} is malformed: expected 64 hex characters (optionally 0x-prefixed), got ${body.length} characters. The value itself is not shown.`
499
+ );
500
+ }
501
+ if (/^0{64}$/.test(body)) {
502
+ throw new PrivateKeyFormatError(
503
+ `${envVarName} is all zeros - that is the .env.example placeholder, not a real key.`
504
+ );
505
+ }
506
+ return `0x${body.toLowerCase()}`;
507
+ }
508
+ function isValidPrivateKey(raw) {
509
+ try {
510
+ normalizePrivateKey(raw, "key");
511
+ return true;
512
+ } catch {
513
+ return false;
514
+ }
515
+ }
516
+ var LENS_OVERRIDE_ADDRESS = "0x00000000000000000000000000000000BEAC0E75";
517
+ function toCheckpoint(raw) {
518
+ return {
519
+ clearingPriceQ96: raw.clearingPrice,
520
+ currencyRaisedAtClearingPriceQ96X7: raw.currencyRaisedAtClearingPriceQ96_X7,
521
+ cumulativeMpsPerPrice: raw.cumulativeMpsPerPrice,
522
+ cumulativeMps: Number(raw.cumulativeMps),
523
+ prevBlock: BigInt(raw.prev),
524
+ nextBlock: BigInt(raw.next)
525
+ };
526
+ }
527
+ async function getAuctionState(client, auction) {
528
+ const data = viem.encodeFunctionData({
529
+ abi: auctionStateLensAbi,
530
+ functionName: "state",
531
+ args: [auction]
532
+ });
533
+ const useOverride = client.lensAddress === void 0;
534
+ const target = client.lensAddress ?? LENS_OVERRIDE_ADDRESS;
535
+ const { data: returnData } = await client.publicClient.call({
536
+ to: target,
537
+ data,
538
+ ...useOverride ? {
539
+ stateOverride: [
540
+ { address: LENS_OVERRIDE_ADDRESS, code: auctionStateLensDeployedBytecode }
541
+ ]
542
+ } : {}
543
+ });
544
+ if (!returnData) {
545
+ throw new Error(
546
+ `AuctionStateLens.state(${auction}) returned no data. Is ${auction} really a ContinuousClearingAuction on ${client.chain.name}?`
547
+ );
548
+ }
549
+ const raw = viem.decodeFunctionResult({
550
+ abi: auctionStateLensAbi,
551
+ functionName: "state",
552
+ data: returnData
553
+ });
554
+ return {
555
+ checkpoint: toCheckpoint(raw.checkpoint),
556
+ currencyRaised: raw.currencyRaised,
557
+ totalCleared: raw.totalCleared,
558
+ isGraduated: raw.isGraduated
559
+ };
560
+ }
561
+ async function getAuctionInfo(client, auction) {
562
+ const contract = { address: auction, abi: auctionAbi };
563
+ const [token, currency, totalSupply, startBlock, endBlock, floorPrice, tickSpacing] = await client.publicClient.multicall({
564
+ allowFailure: false,
565
+ contracts: [
566
+ { ...contract, functionName: "token" },
567
+ { ...contract, functionName: "currency" },
568
+ { ...contract, functionName: "totalSupply" },
569
+ { ...contract, functionName: "startBlock" },
570
+ { ...contract, functionName: "endBlock" },
571
+ { ...contract, functionName: "floorPrice" },
572
+ { ...contract, functionName: "tickSpacing" }
573
+ ]
574
+ });
575
+ return {
576
+ auction,
577
+ token,
578
+ currency,
579
+ totalSupply,
580
+ startBlock: BigInt(startBlock),
581
+ endBlock: BigInt(endBlock),
582
+ floorPriceQ96: floorPrice,
583
+ tickSpacing
584
+ };
585
+ }
586
+ async function getClearingPrice(client, auction) {
587
+ return client.publicClient.readContract({
588
+ address: auction,
589
+ abi: auctionAbi,
590
+ functionName: "clearingPrice"
591
+ });
592
+ }
593
+ async function isGraduated(client, auction) {
594
+ return client.publicClient.readContract({
595
+ address: auction,
596
+ abi: auctionAbi,
597
+ functionName: "isGraduated"
598
+ });
599
+ }
600
+ function deriveStatus(info, blockNumber) {
601
+ if (blockNumber < info.startBlock) return "pending";
602
+ if (blockNumber <= info.endBlock) return "live";
603
+ return "ended";
604
+ }
605
+ async function getAuctionSummary(client, auction, options = {}) {
606
+ const [info, state, blockNumber] = await Promise.all([
607
+ options.info ?? getAuctionInfo(client, auction),
608
+ getAuctionState(client, auction),
609
+ options.blockNumber ?? client.publicClient.getBlockNumber()
610
+ ]);
611
+ const status = deriveStatus(info, blockNumber);
612
+ const blocksRemaining = status === "pending" ? info.startBlock - blockNumber : status === "live" ? info.endBlock - blockNumber : 0n;
613
+ return {
614
+ info,
615
+ state,
616
+ blockNumber,
617
+ status,
618
+ clearingPrice: formatQ96(state.checkpoint.clearingPriceQ96),
619
+ supplyScheduleProgress: mpsToFraction(state.checkpoint.cumulativeMps),
620
+ hasClearedSupply: state.totalCleared > 0n,
621
+ blocksRemaining,
622
+ secondsRemaining: Number(blocksRemaining) * client.blockTimeSeconds
623
+ };
624
+ }
625
+ function isFailedSummary(result) {
626
+ return "error" in result;
627
+ }
628
+ async function getAuctionSummaries(client, auctions, options = {}) {
629
+ const concurrency = options.concurrency ?? 5;
630
+ const blockNumber = await client.publicClient.getBlockNumber();
631
+ const results = [];
632
+ for (let i = 0; i < auctions.length; i += concurrency) {
633
+ const batch = auctions.slice(i, i + concurrency);
634
+ const settled = await Promise.all(
635
+ batch.map(async (auction) => {
636
+ try {
637
+ return await getAuctionSummary(client, auction, { blockNumber });
638
+ } catch (error) {
639
+ return { auction, error };
640
+ }
641
+ })
642
+ );
643
+ results.push(...settled);
644
+ }
645
+ return results;
646
+ }
647
+ async function getAuctionListStates(client, auctions) {
648
+ const result = /* @__PURE__ */ new Map();
649
+ if (auctions.length === 0) return result;
650
+ const contracts = auctions.flatMap((auction) => {
651
+ const base = { address: auction, abi: auctionAbi };
652
+ return [
653
+ { ...base, functionName: "clearingPrice" },
654
+ { ...base, functionName: "isGraduated" },
655
+ { ...base, functionName: "currencyRaised" },
656
+ { ...base, functionName: "totalCleared" }
657
+ ];
658
+ });
659
+ const responses = await client.publicClient.multicall({ allowFailure: true, contracts });
660
+ auctions.forEach((auction, index) => {
661
+ const [price, graduated, raised, cleared] = responses.slice(index * 4, index * 4 + 4);
662
+ if (price?.status !== "success") return;
663
+ result.set(auction, {
664
+ auction,
665
+ clearingPriceQ96: price.result,
666
+ isGraduated: graduated?.status === "success" ? graduated.result : false,
667
+ currencyRaised: raised?.status === "success" ? raised.result : 0n,
668
+ totalCleared: cleared?.status === "success" ? cleared.result : 0n
669
+ });
670
+ });
671
+ return result;
672
+ }
673
+ var erc20ApprovalAbi = [
674
+ ...erc20MetadataAbi,
675
+ {
676
+ type: "function",
677
+ name: "allowance",
678
+ inputs: [
679
+ { name: "owner", type: "address" },
680
+ { name: "spender", type: "address" }
681
+ ],
682
+ outputs: [{ type: "uint256" }],
683
+ stateMutability: "view"
684
+ },
685
+ {
686
+ type: "function",
687
+ name: "approve",
688
+ inputs: [
689
+ { name: "spender", type: "address" },
690
+ { name: "amount", type: "uint256" }
691
+ ],
692
+ outputs: [{ type: "bool" }],
693
+ stateMutability: "nonpayable"
694
+ },
695
+ {
696
+ type: "function",
697
+ name: "balanceOf",
698
+ inputs: [{ name: "account", type: "address" }],
699
+ outputs: [{ type: "uint256" }],
700
+ stateMutability: "view"
701
+ }
702
+ ];
703
+ var permit2Abi = [
704
+ {
705
+ type: "function",
706
+ name: "allowance",
707
+ inputs: [
708
+ { name: "user", type: "address" },
709
+ { name: "token", type: "address" },
710
+ { name: "spender", type: "address" }
711
+ ],
712
+ outputs: [
713
+ { name: "amount", type: "uint160" },
714
+ { name: "expiration", type: "uint48" },
715
+ { name: "nonce", type: "uint48" }
716
+ ],
717
+ stateMutability: "view"
718
+ },
719
+ {
720
+ type: "function",
721
+ name: "approve",
722
+ inputs: [
723
+ { name: "token", type: "address" },
724
+ { name: "spender", type: "address" },
725
+ { name: "amount", type: "uint160" },
726
+ { name: "expiration", type: "uint48" }
727
+ ],
728
+ outputs: [],
729
+ stateMutability: "nonpayable"
730
+ }
731
+ ];
732
+ var UINT128_MAX = 2n ** 128n - 1n;
733
+ var UINT160_MAX = 2n ** 160n - 1n;
734
+ var UINT48_MAX = 2n ** 48n - 1n;
735
+ function alignPriceToTickBoundary(priceQ96, tickSpacing) {
736
+ if (tickSpacing <= 0n) {
737
+ throw new RangeError(`alignPriceToTickBoundary: tickSpacing must be positive, got ${tickSpacing}`);
738
+ }
739
+ return priceQ96 / tickSpacing * tickSpacing;
740
+ }
741
+ function isPriceOnTickBoundary(priceQ96, tickSpacing) {
742
+ return tickSpacing > 0n && priceQ96 % tickSpacing === 0n;
743
+ }
744
+ function encodeSubmitBid(params) {
745
+ if (params.amount <= 0n) {
746
+ throw new RangeError(`submitBid: amount must be positive, got ${params.amount}`);
747
+ }
748
+ if (params.amount > UINT128_MAX) {
749
+ throw new RangeError(`submitBid: amount ${params.amount} exceeds uint128.`);
750
+ }
751
+ if (params.maxPriceQ96 <= 0n) {
752
+ throw new RangeError(`submitBid: maxPriceQ96 must be positive, got ${params.maxPriceQ96}`);
753
+ }
754
+ if (params.tickSpacing !== void 0 && !isPriceOnTickBoundary(params.maxPriceQ96, params.tickSpacing)) {
755
+ throw new RangeError(
756
+ `submitBid: maxPriceQ96 ${params.maxPriceQ96} is not a multiple of tickSpacing ${params.tickSpacing} and would revert with TickPriceNotAtBoundary(). Use alignPriceToTickBoundary() first.`
757
+ );
758
+ }
759
+ const data = params.prevTickPriceQ96 === void 0 ? viem.encodeFunctionData({
760
+ abi: auctionAbi,
761
+ functionName: "submitBid",
762
+ // Four args selects the no-hint overload, which passes FLOOR_PRICE.
763
+ args: [params.maxPriceQ96, params.amount, params.owner, params.hookData ?? "0x"]
764
+ }) : viem.encodeFunctionData({
765
+ abi: auctionAbi,
766
+ functionName: "submitBid",
767
+ args: [
768
+ params.maxPriceQ96,
769
+ params.amount,
770
+ params.owner,
771
+ params.prevTickPriceQ96,
772
+ params.hookData ?? "0x"
773
+ ]
774
+ });
775
+ return {
776
+ to: params.auction,
777
+ data,
778
+ // ERC-20 bids are pulled via Permit2; any value sent would revert with
779
+ // CurrencyIsNotNative().
780
+ value: params.isNativeCurrency ? params.amount : 0n
781
+ };
782
+ }
783
+ async function getPrevTickHint(client, auction, maxPriceQ96) {
784
+ const [floorPrice, nextActive] = await client.publicClient.multicall({
785
+ allowFailure: false,
786
+ contracts: [
787
+ { address: auction, abi: auctionAbi, functionName: "floorPrice" },
788
+ { address: auction, abi: auctionAbi, functionName: "nextActiveTickPrice" }
789
+ ]
790
+ });
791
+ if (nextActive > floorPrice && nextActive < maxPriceQ96) return nextActive;
792
+ return floorPrice;
793
+ }
794
+ function encodeApproveErc20ToPermit2(currency, amount = viem.maxUint256) {
795
+ return {
796
+ to: currency,
797
+ data: viem.encodeFunctionData({
798
+ abi: erc20ApprovalAbi,
799
+ functionName: "approve",
800
+ args: [PERMIT2_ADDRESS, amount]
801
+ }),
802
+ value: 0n
803
+ };
804
+ }
805
+ function encodeApprovePermit2(currency, auction, amount = UINT160_MAX, expiration) {
806
+ if (amount > UINT160_MAX) {
807
+ throw new RangeError(`Permit2 approve: amount ${amount} exceeds uint160.`);
808
+ }
809
+ const expiry = expiration ?? BigInt(Math.floor(Date.now() / 1e3) + 30 * 24 * 60 * 60);
810
+ if (expiry > UINT48_MAX) {
811
+ throw new RangeError(`Permit2 approve: expiration ${expiry} exceeds uint48.`);
812
+ }
813
+ return {
814
+ to: PERMIT2_ADDRESS,
815
+ data: viem.encodeFunctionData({
816
+ abi: permit2Abi,
817
+ functionName: "approve",
818
+ args: [currency, auction, amount, Number(expiry)]
819
+ }),
820
+ value: 0n
821
+ };
822
+ }
823
+ async function checkBidReadiness(client, params) {
824
+ if (params.currency === NATIVE_CURRENCY) {
825
+ const balance2 = await client.publicClient.getBalance({ address: params.bidder });
826
+ return {
827
+ hasBalance: balance2 >= params.amount,
828
+ balance: balance2,
829
+ erc20AllowanceToPermit2: viem.maxUint256,
830
+ permit2AllowanceToAuction: viem.maxUint256,
831
+ permit2Expiration: viem.maxUint256,
832
+ needsErc20Approval: false,
833
+ needsPermit2Approval: false,
834
+ needsApproval: false
835
+ };
836
+ }
837
+ const [balance, erc20Allowance, permit2Allowance] = await client.publicClient.multicall({
838
+ allowFailure: false,
839
+ contracts: [
840
+ {
841
+ address: params.currency,
842
+ abi: erc20ApprovalAbi,
843
+ functionName: "balanceOf",
844
+ args: [params.bidder]
845
+ },
846
+ {
847
+ address: params.currency,
848
+ abi: erc20ApprovalAbi,
849
+ functionName: "allowance",
850
+ args: [params.bidder, PERMIT2_ADDRESS]
851
+ },
852
+ {
853
+ address: PERMIT2_ADDRESS,
854
+ abi: permit2Abi,
855
+ functionName: "allowance",
856
+ args: [params.bidder, params.currency, params.auction]
857
+ }
858
+ ]
859
+ });
860
+ const [permit2Amount, permit2Expiration] = permit2Allowance;
861
+ const nowSeconds = BigInt(Math.floor(Date.now() / 1e3));
862
+ const permit2Expired = BigInt(permit2Expiration) <= nowSeconds;
863
+ const needsErc20Approval = erc20Allowance < params.amount;
864
+ const needsPermit2Approval = permit2Amount < params.amount || permit2Expired;
865
+ return {
866
+ hasBalance: balance >= params.amount,
867
+ balance,
868
+ erc20AllowanceToPermit2: erc20Allowance,
869
+ permit2AllowanceToAuction: permit2Amount,
870
+ permit2Expiration: BigInt(permit2Expiration),
871
+ needsErc20Approval,
872
+ needsPermit2Approval,
873
+ needsApproval: needsErc20Approval || needsPermit2Approval
874
+ };
875
+ }
876
+ function buildBidTransactions(params) {
877
+ const isNative = params.currency === NATIVE_CURRENCY;
878
+ const steps = [];
879
+ if (!isNative) {
880
+ if (params.readiness.needsErc20Approval) {
881
+ steps.push({
882
+ label: "Approve Permit2 to move the bid currency",
883
+ request: encodeApproveErc20ToPermit2(params.currency)
884
+ });
885
+ }
886
+ if (params.readiness.needsPermit2Approval) {
887
+ steps.push({
888
+ label: "Grant the auction a Permit2 allowance",
889
+ request: encodeApprovePermit2(params.currency, params.auction)
890
+ });
891
+ }
892
+ }
893
+ const alignedPriceQ96 = params.tickSpacing === void 0 ? params.maxPriceQ96 : alignPriceToTickBoundary(params.maxPriceQ96, params.tickSpacing);
894
+ steps.push({
895
+ label: "Submit bid",
896
+ request: encodeSubmitBid({
897
+ auction: params.auction,
898
+ maxPriceQ96: alignedPriceQ96,
899
+ amount: params.amount,
900
+ owner: params.owner,
901
+ isNativeCurrency: isNative,
902
+ prevTickPriceQ96: params.prevTickPriceQ96,
903
+ hookData: params.hookData,
904
+ tickSpacing: params.tickSpacing
905
+ })
906
+ });
907
+ return steps;
908
+ }
909
+ function describeBidBlocker(input) {
910
+ if (input.status === "ended") return "This auction has ended - bidding is closed.";
911
+ if (input.status === "pending") return "This auction has not opened yet.";
912
+ if (input.amount <= 0n) return "Enter a bid amount.";
913
+ if (input.maxPriceQ96 <= 0n) return "Enter a maximum price.";
914
+ if (input.maxPriceQ96 < input.floorPriceQ96) {
915
+ return "Your maximum price is below the auction's floor price.";
916
+ }
917
+ if (input.tickSpacing !== void 0) {
918
+ const aligned = alignPriceToTickBoundary(input.maxPriceQ96, input.tickSpacing);
919
+ if (aligned < input.floorPriceQ96) {
920
+ return "Your maximum price rounds down below the auction's floor price.";
921
+ }
922
+ }
923
+ if (input.readiness && !input.readiness.hasBalance) return "Insufficient balance.";
924
+ return null;
925
+ }
926
+
927
+ exports.AuctionParametersError = AuctionParametersError;
928
+ exports.BLOCK_TIME_SECONDS = BLOCK_TIME_SECONDS;
929
+ exports.DEFAULT_LOG_CHUNK_SIZE = DEFAULT_LOG_CHUNK_SIZE;
930
+ exports.FACTORY_ADDRESS = FACTORY_ADDRESS;
931
+ exports.FACTORY_DEPLOY_BLOCK = FACTORY_DEPLOY_BLOCK;
932
+ exports.LENS_OVERRIDE_ADDRESS = LENS_OVERRIDE_ADDRESS;
933
+ exports.MIN_FLOOR_PRICE = MIN_FLOOR_PRICE;
934
+ exports.MIN_TICK_SPACING = MIN_TICK_SPACING;
935
+ exports.MPS = MPS;
936
+ exports.NATIVE_CURRENCY = NATIVE_CURRENCY;
937
+ exports.PERMIT2_ADDRESS = PERMIT2_ADDRESS;
938
+ exports.PrivateKeyFormatError = PrivateKeyFormatError;
939
+ exports.Q96 = Q96;
940
+ exports.SUPPORTED_CHAINS = SUPPORTED_CHAINS;
941
+ exports.UPSTREAM_COMMIT = UPSTREAM_COMMIT;
942
+ exports.UPSTREAM_TAG = UPSTREAM_TAG;
943
+ exports.X7 = X7;
944
+ exports.alignPriceToTickBoundary = alignPriceToTickBoundary;
945
+ exports.assertChainMatches = assertChainMatches;
946
+ exports.assertSupportedChain = assertSupportedChain;
947
+ exports.auctionAbi = auctionAbi;
948
+ exports.auctionCreatedEvent = auctionCreatedEvent;
949
+ exports.auctionStateLensAbi = auctionStateLensAbi;
950
+ exports.auctionStateLensDeployedBytecode = auctionStateLensDeployedBytecode;
951
+ exports.buildAuctionSteps = buildAuctionSteps;
952
+ exports.buildBidTransactions = buildBidTransactions;
953
+ exports.checkBidReadiness = checkBidReadiness;
954
+ exports.createBeaconClient = createBeaconClient;
955
+ exports.decimalToQ96 = decimalToQ96;
956
+ exports.decodeAuctionParameters = decodeAuctionParameters;
957
+ exports.deriveStatus = deriveStatus;
958
+ exports.describeBidBlocker = describeBidBlocker;
959
+ exports.encodeApproveErc20ToPermit2 = encodeApproveErc20ToPermit2;
960
+ exports.encodeApprovePermit2 = encodeApprovePermit2;
961
+ exports.encodeAuctionParameters = encodeAuctionParameters;
962
+ exports.encodeSubmitBid = encodeSubmitBid;
963
+ exports.erc20ApprovalAbi = erc20ApprovalAbi;
964
+ exports.erc20MetadataAbi = erc20MetadataAbi;
965
+ exports.factoryAbi = factoryAbi;
966
+ exports.formatMpsPercent = formatMpsPercent;
967
+ exports.formatQ96 = formatQ96;
968
+ exports.formatQ96Compact = formatQ96Compact;
969
+ exports.formatTokenAmount = formatTokenAmount;
970
+ exports.fromValueX7 = fromValueX7;
971
+ exports.getAuctionInfo = getAuctionInfo;
972
+ exports.getAuctionListStates = getAuctionListStates;
973
+ exports.getAuctionState = getAuctionState;
974
+ exports.getAuctionSummaries = getAuctionSummaries;
975
+ exports.getAuctionSummary = getAuctionSummary;
976
+ exports.getClearingPrice = getClearingPrice;
977
+ exports.getPrevTickHint = getPrevTickHint;
978
+ exports.getTokenMetadata = getTokenMetadata;
979
+ exports.getTokenMetadataBatch = getTokenMetadataBatch;
980
+ exports.isFailedSummary = isFailedSummary;
981
+ exports.isGraduated = isGraduated;
982
+ exports.isPriceOnTickBoundary = isPriceOnTickBoundary;
983
+ exports.isValidPrivateKey = isValidPrivateKey;
984
+ exports.mpsToFraction = mpsToFraction;
985
+ exports.normalizePrivateKey = normalizePrivateKey;
986
+ exports.packAuctionSteps = packAuctionSteps;
987
+ exports.permit2Abi = permit2Abi;
988
+ exports.q96ToDecimalString = q96ToDecimalString;
989
+ exports.q96ToNumber = q96ToNumber;
990
+ exports.scanAuctions = scanAuctions;
991
+ exports.scanAuctionsForToken = scanAuctionsForToken;
992
+ exports.totalBlocks = totalBlocks;
993
+ exports.totalMps = totalMps;
994
+ exports.unpackAuctionSteps = unpackAuctionSteps;
995
+ exports.validateAuctionParameters = validateAuctionParameters;
996
+ exports.watchAuctions = watchAuctions;
997
+ //# sourceMappingURL=index.cjs.map
998
+ //# sourceMappingURL=index.cjs.map