@oakagentkit/core 0.2.4 → 0.2.5
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/build/dist/api/amounts.d.ts +2 -0
- package/build/dist/api/amounts.js +1 -1
- package/build/dist/api/args.js +1 -1
- package/build/dist/api/gas.js +1 -1
- package/build/dist/api/grandfather.js +1 -1
- package/build/dist/api/guards.js +1 -1
- package/build/dist/api/history.js +1 -1
- package/build/dist/api/http.js +1 -1
- package/build/dist/api/merkle.js +1 -1
- package/build/dist/api/module.js +1 -1
- package/build/dist/api/modules/beefy/boosts.js +1 -1
- package/build/dist/api/modules/beefy/clm.js +1 -1
- package/build/dist/api/modules/beefy/guard.js +1 -1
- package/build/dist/api/modules/beefy/index.js +1 -1
- package/build/dist/api/modules/beefy/liquidity.js +1 -1
- package/build/dist/api/modules/beefy/management.js +1 -1
- package/build/dist/api/modules/beefy/vaults.js +1 -1
- package/build/dist/api/modules/borro/abi.d.ts +149 -0
- package/build/dist/api/modules/borro/abi.js +1 -0
- package/build/dist/api/modules/borro/actions.d.ts +2 -0
- package/build/dist/api/modules/borro/actions.js +1 -0
- package/build/dist/api/modules/borro/checks.d.ts +151 -0
- package/build/dist/api/modules/borro/checks.js +1 -0
- package/build/dist/api/modules/borro/copy.d.ts +174 -0
- package/build/dist/api/modules/borro/copy.js +1 -0
- package/build/dist/api/modules/borro/index.d.ts +13 -0
- package/build/dist/api/modules/borro/index.js +1 -0
- package/build/dist/api/modules/borro/liquidity.d.ts +4 -0
- package/build/dist/api/modules/borro/liquidity.js +1 -0
- package/build/dist/api/modules/borro/pins.d.ts +264 -0
- package/build/dist/api/modules/borro/pins.js +1 -0
- package/build/dist/api/modules/borro/positions.d.ts +8 -0
- package/build/dist/api/modules/borro/positions.js +1 -0
- package/build/dist/api/modules/borro/rates.d.ts +20 -0
- package/build/dist/api/modules/borro/rates.js +1 -0
- package/build/dist/api/modules/borro/reader.d.ts +32 -0
- package/build/dist/api/modules/borro/reader.js +1 -0
- package/build/dist/api/modules/borro/types.d.ts +120 -0
- package/build/dist/api/modules/borro/types.js +0 -0
- package/build/dist/api/modules/clanker/extensions.js +1 -1
- package/build/dist/api/modules/clanker/index.js +1 -1
- package/build/dist/api/modules/clanker/manage.js +1 -1
- package/build/dist/api/modules/clanker/pool-config.js +1 -1
- package/build/dist/api/modules/clanker/protocol.js +1 -1
- package/build/dist/api/modules/clanker/state.js +1 -1
- package/build/dist/api/modules/earn/copy.d.ts +2 -2
- package/build/dist/api/modules/earn/copy.js +1 -1
- package/build/dist/api/modules/earn/index.js +1 -1
- package/build/dist/api/modules/earn/lp.js +1 -1
- package/build/dist/api/modules/earn/options.js +1 -1
- package/build/dist/api/modules/erc8004/common.js +1 -1
- package/build/dist/api/modules/erc8004/domain.js +1 -1
- package/build/dist/api/modules/erc8004/index.js +1 -1
- package/build/dist/api/modules/erc8004/management.js +1 -1
- package/build/dist/api/modules/erc8004/reputation.js +1 -1
- package/build/dist/api/modules/erc8004/services.js +1 -1
- package/build/dist/api/modules/erc8004/validation.js +1 -1
- package/build/dist/api/modules/grove/index.js +1 -1
- package/build/dist/api/modules/heyresearch/builder-feed.js +1 -1
- package/build/dist/api/modules/heyresearch/index.js +1 -1
- package/build/dist/api/modules/heyresearch/proof-reads.js +1 -1
- package/build/dist/api/modules/heyresearch/public-reads.js +1 -1
- package/build/dist/api/modules/heyresearch/scan.js +1 -1
- package/build/dist/api/modules/heyresearch/token-facts.js +1 -1
- package/build/dist/api/modules/hoodag/chain-reads.js +1 -1
- package/build/dist/api/modules/hoodag/index.js +1 -1
- package/build/dist/api/modules/hoodag/management.js +1 -1
- package/build/dist/api/modules/hoodag/public-reads.js +1 -1
- package/build/dist/api/modules/hoodag/reconstruct.js +1 -1
- package/build/dist/api/modules/hoodlock/airdrop.js +1 -1
- package/build/dist/api/modules/hoodlock/commerce.js +1 -1
- package/build/dist/api/modules/hoodlock/fee.js +1 -1
- package/build/dist/api/modules/hoodlock/guard.js +1 -1
- package/build/dist/api/modules/hoodlock/index.js +1 -1
- package/build/dist/api/modules/hoodlock/lifecycle.js +1 -1
- package/build/dist/api/modules/hoodlock/locks-burn.js +1 -1
- package/build/dist/api/modules/hoodlock/public.js +1 -1
- package/build/dist/api/modules/hookr/actions.js +1 -1
- package/build/dist/api/modules/hookr/addons.js +1 -1
- package/build/dist/api/modules/hookr/agent-gate.js +1 -1
- package/build/dist/api/modules/hookr/contracts.js +1 -1
- package/build/dist/api/modules/hookr/create-cancel.js +1 -1
- package/build/dist/api/modules/hookr/discovery.js +1 -1
- package/build/dist/api/modules/hookr/fill-bounty.js +1 -1
- package/build/dist/api/modules/hookr/index.js +1 -1
- package/build/dist/api/modules/hookr/launch-options.js +1 -1
- package/build/dist/api/modules/hookr/launch-receipt.js +1 -1
- package/build/dist/api/modules/hookr/launch.js +1 -1
- package/build/dist/api/modules/hookr/liquidity.js +1 -1
- package/build/dist/api/modules/hookr/lp-positions.js +1 -1
- package/build/dist/api/modules/hookr/lp-reads.js +1 -1
- package/build/dist/api/modules/hookr/lp-receipt.js +1 -1
- package/build/dist/api/modules/hookr/lp-state.js +1 -1
- package/build/dist/api/modules/hookr/public-reads.js +1 -1
- package/build/dist/api/modules/hookr/read-utils.js +1 -1
- package/build/dist/api/modules/hookr/relay.js +1 -1
- package/build/dist/api/modules/hookr/revenue.js +1 -1
- package/build/dist/api/modules/kyberswap/index.js +1 -1
- package/build/dist/api/modules/kyberswap/source-pools.js +1 -1
- package/build/dist/api/modules/layerbank/actions.js +1 -1
- package/build/dist/api/modules/layerbank/checks.js +1 -1
- package/build/dist/api/modules/layerbank/index.js +1 -1
- package/build/dist/api/modules/layerbank/merkl.js +1 -1
- package/build/dist/api/modules/layerbank/reader.js +1 -1
- package/build/dist/api/modules/layerbank/reserve.js +1 -1
- package/build/dist/api/modules/lighter/index.js +1 -1
- package/build/dist/api/modules/longbow/administration.js +1 -1
- package/build/dist/api/modules/longbow/analytics.js +1 -1
- package/build/dist/api/modules/longbow/fixed.js +1 -1
- package/build/dist/api/modules/longbow/index.js +1 -1
- package/build/dist/api/modules/longbow/nft.js +1 -1
- package/build/dist/api/modules/longbow/rebates.js +1 -1
- package/build/dist/api/modules/longbow/staking.js +1 -1
- package/build/dist/api/modules/meridian/index.js +1 -1
- package/build/dist/api/modules/meridian/markets.js +1 -1
- package/build/dist/api/modules/meridian/perps-batch.js +1 -1
- package/build/dist/api/modules/meridian/perps-common.js +1 -1
- package/build/dist/api/modules/meridian/perps-guards.js +1 -1
- package/build/dist/api/modules/meridian/perps-intents.js +1 -1
- package/build/dist/api/modules/meridian/perps-stream.js +1 -1
- package/build/dist/api/modules/meridian/perps.d.ts +1 -0
- package/build/dist/api/modules/meridian/perps.js +1 -1
- package/build/dist/api/modules/meridian/predict-read.js +1 -1
- package/build/dist/api/modules/meridian/rfq.js +1 -1
- package/build/dist/api/modules/merkl/discovery.js +1 -1
- package/build/dist/api/modules/merkl/index.js +1 -1
- package/build/dist/api/modules/merkl/manage.js +1 -1
- package/build/dist/api/modules/merkl/protocol.js +1 -1
- package/build/dist/api/modules/morpho/allocator.js +1 -1
- package/build/dist/api/modules/morpho/bundles.js +1 -1
- package/build/dist/api/modules/morpho/in-kind.js +1 -1
- package/build/dist/api/modules/morpho/index.js +1 -1
- package/build/dist/api/modules/morpho/local-guard.js +1 -1
- package/build/dist/api/modules/morpho/midnight.js +1 -1
- package/build/dist/api/modules/morpho/protocol.js +1 -1
- package/build/dist/api/modules/morpho/vault-management.js +1 -1
- package/build/dist/api/modules/morpho/vault-tools.js +1 -1
- package/build/dist/api/modules/morpho/vault-v2.js +1 -1
- package/build/dist/api/modules/netnet/card-plan.js +1 -1
- package/build/dist/api/modules/netnet/card-read.js +1 -1
- package/build/dist/api/modules/netnet/card-recovery.js +1 -1
- package/build/dist/api/modules/netnet/desk-action.js +1 -1
- package/build/dist/api/modules/netnet/financial.js +1 -1
- package/build/dist/api/modules/netnet/index.js +1 -1
- package/build/dist/api/modules/netnet/staking.js +1 -1
- package/build/dist/api/modules/orbio/gateway.js +1 -1
- package/build/dist/api/modules/orbio/index.js +1 -1
- package/build/dist/api/modules/orbio/positions.js +1 -1
- package/build/dist/api/modules/pendle/convert.js +1 -1
- package/build/dist/api/modules/pendle/costs.js +1 -1
- package/build/dist/api/modules/pendle/index.js +1 -1
- package/build/dist/api/modules/pendle/markets.js +1 -1
- package/build/dist/api/modules/pendle/positions.js +1 -1
- package/build/dist/api/modules/pendle/pricecheck.js +1 -1
- package/build/dist/api/modules/pendle/reader.js +1 -1
- package/build/dist/api/modules/pendle/redeem.js +1 -1
- package/build/dist/api/modules/pendle/trade.js +1 -1
- package/build/dist/api/modules/pendle/types.d.ts +16 -1
- package/build/dist/api/modules/pendle/validate.js +1 -1
- package/build/dist/api/modules/pendle/verify.js +1 -1
- package/build/dist/api/modules/pons/claim.js +1 -1
- package/build/dist/api/modules/pons/holder-directory.js +1 -1
- package/build/dist/api/modules/pons/index.js +1 -1
- package/build/dist/api/modules/pons/launch-status.js +1 -1
- package/build/dist/api/modules/pons/prices.js +1 -1
- package/build/dist/api/modules/pons/reads.js +1 -1
- package/build/dist/api/modules/pons/swap-terms.js +1 -1
- package/build/dist/api/modules/pons/trade.js +1 -1
- package/build/dist/api/modules/poolstrade/index.js +1 -1
- package/build/dist/api/modules/priors/coverage.js +1 -1
- package/build/dist/api/modules/priors/discovery.js +1 -1
- package/build/dist/api/modules/priors/features.js +1 -1
- package/build/dist/api/modules/priors/holdings.js +1 -1
- package/build/dist/api/modules/priors/index.js +1 -1
- package/build/dist/api/modules/priors/integration.js +1 -1
- package/build/dist/api/modules/priors/market.js +1 -1
- package/build/dist/api/modules/priors/pt.js +1 -1
- package/build/dist/api/modules/priors/savings-exit.js +1 -1
- package/build/dist/api/modules/priors/starter-line.js +1 -1
- package/build/dist/api/modules/priors/stock-swap.js +1 -1
- package/build/dist/api/modules/relay/api.js +1 -1
- package/build/dist/api/modules/relay/bootstrap.js +1 -1
- package/build/dist/api/modules/relay/discovery.js +1 -1
- package/build/dist/api/modules/relay/inbound.d.ts +2 -0
- package/build/dist/api/modules/relay/inbound.js +1 -1
- package/build/dist/api/modules/relay/index.js +1 -1
- package/build/dist/api/modules/relay/order.js +1 -1
- package/build/dist/api/modules/relay/outbound-status.js +1 -1
- package/build/dist/api/modules/relay/readiness.js +1 -1
- package/build/dist/api/modules/relay/reads.js +1 -1
- package/build/dist/api/modules/relay/vaults.js +1 -1
- package/build/dist/api/modules/spark/actions.js +1 -1
- package/build/dist/api/modules/spark/details.js +1 -1
- package/build/dist/api/modules/spark/index.js +1 -1
- package/build/dist/api/modules/spark/management.js +1 -1
- package/build/dist/api/modules/steakhouse/analytics.js +1 -1
- package/build/dist/api/modules/steakhouse/erc4626.js +1 -1
- package/build/dist/api/modules/steakhouse/index.js +1 -1
- package/build/dist/api/modules/steakhouse/local-guard.js +1 -1
- package/build/dist/api/modules/steakhouse/management.js +1 -1
- package/build/dist/api/modules/steakhouse/v2-exit.js +1 -1
- package/build/dist/api/modules/tickerspring/basket-routes.js +1 -1
- package/build/dist/api/modules/tickerspring/contract-reads.js +1 -1
- package/build/dist/api/modules/tickerspring/exit-preview.js +1 -1
- package/build/dist/api/modules/tickerspring/guards.js +1 -1
- package/build/dist/api/modules/tickerspring/index.js +1 -1
- package/build/dist/api/modules/tickerspring/journeys.js +1 -1
- package/build/dist/api/modules/tickerspring/ladder.js +1 -1
- package/build/dist/api/modules/tickerspring/maker.js +1 -1
- package/build/dist/api/modules/tickerspring/order-accounting.js +1 -1
- package/build/dist/api/modules/tickerspring/research.js +1 -1
- package/build/dist/api/modules/tickerspring/strategies.js +1 -1
- package/build/dist/api/modules/uniswap/auction-create.js +1 -1
- package/build/dist/api/modules/uniswap/auction.js +1 -1
- package/build/dist/api/modules/uniswap/batch.js +1 -1
- package/build/dist/api/modules/uniswap/common.js +1 -1
- package/build/dist/api/modules/uniswap/fees.js +1 -1
- package/build/dist/api/modules/uniswap/index.js +1 -1
- package/build/dist/api/modules/uniswap/local-guard.js +1 -1
- package/build/dist/api/modules/uniswap/oracle.js +1 -1
- package/build/dist/api/modules/uniswap/pool-math.js +1 -1
- package/build/dist/api/modules/uniswap/pools.js +1 -1
- package/build/dist/api/modules/uniswap/position.js +1 -1
- package/build/dist/api/modules/uniswap/protocol.js +1 -1
- package/build/dist/api/modules/uniswap/token-jar.js +1 -1
- package/build/dist/api/modules/uniswap/trade-batch.js +1 -1
- package/build/dist/api/modules/uniswap/trade.js +1 -1
- package/build/dist/api/modules/uniswap/v2.js +1 -1
- package/build/dist/api/modules/uniswap/v3.d.ts +11 -1
- package/build/dist/api/modules/uniswap/v3.js +1 -1
- package/build/dist/api/modules/uniswap/v4.js +1 -1
- package/build/dist/api/modules/uniswap/wrap.js +1 -1
- package/build/dist/api/modules/velora/claims.js +1 -1
- package/build/dist/api/modules/velora/delta-reads.js +1 -1
- package/build/dist/api/modules/velora/index.js +1 -1
- package/build/dist/api/modules/wormhole/index.js +1 -1
- package/build/dist/api/modules/wormhole/scan-text.js +1 -1
- package/build/dist/api/modules/wormhole/token-check.js +1 -1
- package/build/dist/api/positions.js +1 -1
- package/build/dist/api/pricenote.js +1 -1
- package/build/dist/api/prices.js +1 -1
- package/build/dist/api/pricing.js +1 -1
- package/build/dist/api/routes.js +1 -1
- package/build/dist/api/send.js +1 -1
- package/build/dist/api/signing-registry.js +1 -1
- package/build/dist/api/simulate.js +1 -1
- package/build/dist/api/swap.js +1 -1
- package/build/dist/api/tokens.d.ts +1 -0
- package/build/dist/api/tokens.js +1 -1
- package/build/dist/api/tool-policy.js +1 -1
- package/build/dist/api/tx.js +1 -1
- package/build/dist/api/vendor-limits.js +1 -1
- package/build/dist/chunks/{BAAXGB4K.js → 2KYAMXTS.js} +1 -1
- package/build/dist/chunks/{WVONJOWN.js → 2MAMJJJC.js} +1 -1
- package/build/dist/chunks/{MKAPRRKF.js → 2TK3ETUO.js} +1 -1
- package/build/dist/chunks/{CTMA4BTM.js → 326QMOTR.js} +1 -1
- package/build/dist/chunks/{ALRRW7SF.js → 3FUVMSCF.js} +1 -1
- package/build/dist/chunks/{YPM2UITD.js → 3GOHSYHW.js} +1 -1
- package/build/dist/chunks/{HTXKERNS.js → 3MLUCYCB.js} +1 -1
- package/build/dist/chunks/{GHPREYQK.js → 3NJ5KQ3Q.js} +1 -1
- package/build/dist/chunks/{WPFAEBE7.js → 3XNZUIRU.js} +1 -1
- package/build/dist/chunks/3XXBLNEX.js +1 -0
- package/build/dist/chunks/{PBQSJSZO.js → 43LI5NKJ.js} +1 -1
- package/build/dist/chunks/{NZXQWDGF.js → 45BRW2ZF.js} +1 -1
- package/build/dist/chunks/{QVYCJ6WV.js → 46KWRAYK.js} +1 -1
- package/build/dist/chunks/{UHRCM7AG.js → 4HG6FRVH.js} +1 -1
- package/build/dist/chunks/{TBCSZDAF.js → 4MXM6Q4W.js} +1 -1
- package/build/dist/chunks/{ZCOFMGPS.js → 4PY3UFNR.js} +1 -1
- package/build/dist/chunks/{WIVYKLQM.js → 52ELWNXJ.js} +1 -1
- package/build/dist/chunks/{F3BSEE52.js → 553UE2ZQ.js} +1 -1
- package/build/dist/chunks/{S2TAJHHK.js → 57MEFFCU.js} +1 -1
- package/build/dist/chunks/{ENX72ARB.js → 5APS4T2D.js} +1 -1
- package/build/dist/chunks/{UA4O226F.js → 5SMVQCAP.js} +1 -1
- package/build/dist/chunks/{6PY3IRDS.js → 64GOINYS.js} +1 -1
- package/build/dist/chunks/{5ZLOCQA4.js → 66F5ZH34.js} +1 -1
- package/build/dist/chunks/{HVM2EEXB.js → 6B3VVISQ.js} +1 -1
- package/build/dist/chunks/{E6RRXNV2.js → 6D5DJA5B.js} +1 -1
- package/build/dist/chunks/{XDZRO5JQ.js → 6I4NTKB2.js} +1 -1
- package/build/dist/chunks/{MFCPL6LF.js → 6OGDTEGH.js} +1 -1
- package/build/dist/chunks/6PBGEPUK.js +20 -0
- package/build/dist/chunks/{43CSMYDO.js → 6WD4HHID.js} +1 -1
- package/build/dist/chunks/{XJEOEMDS.js → 6WZX7C4T.js} +1 -1
- package/build/dist/chunks/{NA7R6J5N.js → 74Y2KDNR.js} +1 -1
- package/build/dist/chunks/{IKEJCBYU.js → 7WSHW7KW.js} +1 -1
- package/build/dist/chunks/{UPMGGK34.js → AFBEZXNV.js} +1 -1
- package/build/dist/chunks/{AUOXDNUO.js → AKYF5264.js} +1 -1
- package/build/dist/chunks/{BXHNYCH2.js → APGLZXIW.js} +1 -1
- package/build/dist/chunks/{7UOOIDR3.js → AVG4W3Y7.js} +1 -1
- package/build/dist/chunks/{Y7PRJOIK.js → B3RXD5ET.js} +1 -1
- package/build/dist/chunks/{JPNYUEQP.js → BBS3ODWZ.js} +1 -1
- package/build/dist/chunks/{I4TGMF2C.js → BJ2VGRF4.js} +1 -1
- package/build/dist/chunks/{WD37MEMZ.js → BTD5SMOW.js} +1 -1
- package/build/dist/chunks/{57JFKIMK.js → BTPXJAUX.js} +1 -1
- package/build/dist/chunks/{BIRMUW7Z.js → C36BFZH6.js} +1 -1
- package/build/dist/chunks/{ZGKVXFM5.js → C7AXJHBT.js} +1 -1
- package/build/dist/chunks/{5U7TCKX2.js → CBG5HARQ.js} +1 -1
- package/build/dist/chunks/{ET23SES4.js → CCTXCMH4.js} +1 -1
- package/build/dist/chunks/{5N4A5XAW.js → CHXBOXOD.js} +1 -1
- package/build/dist/chunks/D3YLXQPW.js +1 -0
- package/build/dist/chunks/{L7OQUHM5.js → DJN3JAWB.js} +1 -1
- package/build/dist/chunks/{CERNEJ2F.js → DW4V5PUY.js} +1 -1
- package/build/dist/chunks/E3RACZUY.js +1 -0
- package/build/dist/chunks/{TPL4U3AQ.js → E674J2MD.js} +1 -1
- package/build/dist/chunks/EE64JSLY.js +1 -0
- package/build/dist/chunks/EJ7O75A7.js +1 -0
- package/build/dist/chunks/{3AXVB23N.js → ELSXLZN5.js} +1 -1
- package/build/dist/chunks/{IQGY5FW7.js → ER47KGRM.js} +1 -1
- package/build/dist/chunks/FQ6UZCM6.js +1 -0
- package/build/dist/chunks/{WPAF55SP.js → GEIFITAQ.js} +1 -1
- package/build/dist/chunks/{4ALMYJJV.js → GGSAKCND.js} +1 -1
- package/build/dist/chunks/{EKNSLLJK.js → GL4NCUMH.js} +1 -1
- package/build/dist/chunks/GNC6RXLT.js +1 -0
- package/build/dist/chunks/{VVA72C6O.js → GQ5GYUEH.js} +1 -1
- package/build/dist/chunks/{6AAARNZ3.js → GW626GG2.js} +1 -1
- package/build/dist/chunks/{LROVANUR.js → H2XDMFQQ.js} +1 -1
- package/build/dist/chunks/H43RNCX2.js +1 -0
- package/build/dist/chunks/{VHLINDDS.js → HAQPIBYR.js} +1 -1
- package/build/dist/chunks/{ZE7EU2CS.js → HCUHMCBW.js} +1 -1
- package/build/dist/chunks/{64WKYWZV.js → HKEMQBFA.js} +1 -1
- package/build/dist/chunks/{4YFVAYKR.js → HM72DH4V.js} +1 -1
- package/build/dist/chunks/HSCQZ66A.js +1 -0
- package/build/dist/chunks/{QRC4ZPDA.js → I26DMNJG.js} +1 -1
- package/build/dist/chunks/{S3FPF537.js → IMO3GDA5.js} +1 -1
- package/build/dist/chunks/{ECWGKLBW.js → INOZIE55.js} +1 -1
- package/build/dist/chunks/{BQICZFLR.js → IOYRL6AY.js} +1 -1
- package/build/dist/chunks/IX3GZMTM.js +1 -0
- package/build/dist/chunks/IY7BXLT4.js +1 -0
- package/build/dist/chunks/{NYNJITCM.js → J2OT4KAH.js} +1 -1
- package/build/dist/chunks/{Y7RPSDD2.js → JKD2B6OX.js} +1 -1
- package/build/dist/chunks/{PSVOVZH7.js → JUZ5JU6D.js} +5 -5
- package/build/dist/chunks/{YEXUSRIZ.js → JVLLVNF2.js} +1 -1
- package/build/dist/chunks/{SSIENQVU.js → K3RDPI5J.js} +1 -1
- package/build/dist/chunks/{PADWZX7J.js → K4DHHQBI.js} +1 -1
- package/build/dist/chunks/KIFSRO5K.js +1 -0
- package/build/dist/chunks/{NB3LYS3G.js → KIFZ5ZSK.js} +1 -1
- package/build/dist/chunks/{QSN6Y2K6.js → KPCY5V35.js} +1 -1
- package/build/dist/chunks/{3ESNHZT5.js → L4N2RSK2.js} +1 -1
- package/build/dist/chunks/{EYFBVQ46.js → L5BLHY34.js} +1 -1
- package/build/dist/chunks/{E6UU7DL2.js → LSXUAHOE.js} +1 -1
- package/build/dist/chunks/{BNG2IWZL.js → M37654RL.js} +1 -1
- package/build/dist/chunks/{XFKVU46U.js → MJ6WEWMI.js} +1 -1
- package/build/dist/chunks/{47YN4OUI.js → MR5L7V6Z.js} +1 -1
- package/build/dist/chunks/{DVVFT42J.js → MRMR4QHA.js} +1 -1
- package/build/dist/chunks/{WWHCEMNB.js → N4Q6GN65.js} +1 -1
- package/build/dist/chunks/{S5WICHIS.js → NAZPDRIF.js} +1 -1
- package/build/dist/chunks/{MKBNLGDD.js → NDCLTVIU.js} +1 -1
- package/build/dist/chunks/{5WUKOQIJ.js → NEEZBJBC.js} +1 -1
- package/build/dist/chunks/{HSFOWJ3Z.js → NKZKKCK2.js} +1 -1
- package/build/dist/chunks/{5KUWLUPM.js → NWNYJ26T.js} +1 -1
- package/build/dist/chunks/{KBXU7U6Q.js → O7HCEPQY.js} +1 -1
- package/build/dist/chunks/{LDT3QTSY.js → OJ4WJUPP.js} +1 -1
- package/build/dist/chunks/{QJFXLYZG.js → OJPG45AC.js} +1 -1
- package/build/dist/chunks/{5MQ5KSSV.js → OKUO3BVM.js} +1 -1
- package/build/dist/chunks/OTXSKFUD.js +1 -0
- package/build/dist/chunks/{4TQQH7N6.js → P3S4BR5G.js} +1 -1
- package/build/dist/chunks/P56RZC2M.js +1 -0
- package/build/dist/chunks/{BK23XJXE.js → P5PYFK7L.js} +1 -1
- package/build/dist/chunks/{ZYH4B2GR.js → P7I62KFR.js} +1 -1
- package/build/dist/chunks/{SQL6HD5E.js → PK66GCDT.js} +1 -1
- package/build/dist/chunks/{6FTYNYGF.js → PSBQWDYI.js} +1 -1
- package/build/dist/chunks/{W76QC2AW.js → PV5FDT6O.js} +1 -1
- package/build/dist/chunks/{42DQTKEO.js → PXT5YTWU.js} +1 -1
- package/build/dist/chunks/{IMRXZ7JB.js → Q42YI3EP.js} +1 -1
- package/build/dist/chunks/{ZBFKKUNP.js → QA3UHEO3.js} +1 -1
- package/build/dist/chunks/QC3HH5UD.js +3 -0
- package/build/dist/chunks/{MQYOG66Q.js → QF52OIBS.js} +1 -1
- package/build/dist/chunks/{7WQEPZJY.js → QO3KCJMP.js} +1 -1
- package/build/dist/chunks/QQECG3WP.js +1 -0
- package/build/dist/chunks/QSHCBASA.js +1 -0
- package/build/dist/chunks/{RVO3QK2B.js → QU5XKRGK.js} +1 -1
- package/build/dist/chunks/{GVPX5XCL.js → QZZ4O34L.js} +1 -1
- package/build/dist/chunks/{A6YQ5H24.js → RQ4GHJXE.js} +1 -1
- package/build/dist/chunks/{3WXK2FUA.js → RUC7KH7A.js} +1 -1
- package/build/dist/chunks/{MBTARLZQ.js → RUX3RY7Y.js} +1 -1
- package/build/dist/chunks/{3VAJW6TQ.js → RVDUSNWW.js} +1 -1
- package/build/dist/chunks/{SDHPFXRM.js → S47VUTHM.js} +1 -1
- package/build/dist/chunks/{OTIXQZ3X.js → S7IFAQPG.js} +1 -1
- package/build/dist/chunks/{WMNRP3YH.js → SIYUNOLI.js} +1 -1
- package/build/dist/chunks/{TNKVRVTH.js → SJJR4ZBZ.js} +1 -1
- package/build/dist/chunks/{UFVPMWPJ.js → SMYWWIE6.js} +1 -1
- package/build/dist/chunks/{Z4SRGAVL.js → SPJCSEKP.js} +1 -1
- package/build/dist/chunks/{IQIWASRD.js → SSHCD6RZ.js} +1 -1
- package/build/dist/chunks/{SGEZIYJW.js → T2WHOZXM.js} +1 -1
- package/build/dist/chunks/{WOEKXQAH.js → T3AJSQYT.js} +1 -1
- package/build/dist/chunks/{SKMPKAZI.js → TAEZTP4L.js} +1 -1
- package/build/dist/chunks/{E3UBHTJO.js → TEJ7W534.js} +1 -1
- package/build/dist/chunks/{AWXJV2YH.js → TFDPEAVZ.js} +1 -1
- package/build/dist/chunks/{MGPHD4VV.js → TM2XCRU7.js} +1 -1
- package/build/dist/chunks/{UOGHQLQX.js → TMVO2DAK.js} +1 -1
- package/build/dist/chunks/{MXW2TP5P.js → TVWMTMEF.js} +1 -1
- package/build/dist/chunks/{GRIGSPD4.js → TX2EOIRS.js} +1 -1
- package/build/dist/chunks/{VV2HEIFI.js → U5PMVP56.js} +1 -1
- package/build/dist/chunks/{K72EYD6R.js → U67J4BCH.js} +1 -1
- package/build/dist/chunks/{MDDHG34Y.js → UHTRW2R6.js} +1 -1
- package/build/dist/chunks/{PQC5635W.js → UHVSINR5.js} +1 -1
- package/build/dist/chunks/{MOPETB64.js → UMIZMJWW.js} +1 -1
- package/build/dist/chunks/{F26FK47J.js → UNJJRQIU.js} +1 -1
- package/build/dist/chunks/V74F6IDY.js +1 -0
- package/build/dist/chunks/{MYFAKCQI.js → VEQBHI6O.js} +1 -1
- package/build/dist/chunks/VHV6WQ5F.js +1 -0
- package/build/dist/chunks/{EOQYLFXA.js → VJS4DHQQ.js} +1 -1
- package/build/dist/chunks/{AG67Z3SC.js → VOMGT5SG.js} +1 -1
- package/build/dist/chunks/{D6ZJPNK7.js → VY7XRHZQ.js} +1 -1
- package/build/dist/chunks/{W2OJ57ZO.js → VYAJXLND.js} +1 -1
- package/build/dist/chunks/{LVLVP5KQ.js → VYN2NRAP.js} +1 -1
- package/build/dist/chunks/{MDV7GECM.js → VYYSL557.js} +1 -1
- package/build/dist/chunks/{KA7BPBCV.js → W2BYU5JQ.js} +1 -1
- package/build/dist/chunks/W6BS3T7S.js +1 -0
- package/build/dist/chunks/WCNHZYQQ.js +1 -0
- package/build/dist/chunks/{ALPYEM7B.js → WDK6VOG4.js} +1 -1
- package/build/dist/chunks/{K22EXPWN.js → WIRBCS4W.js} +1 -1
- package/build/dist/chunks/{YRXT3HTW.js → WLMWWEP7.js} +1 -1
- package/build/dist/chunks/{NDW5DAFL.js → WP6RHXGN.js} +1 -1
- package/build/dist/chunks/{PLZKXQ76.js → WTXC3XKW.js} +1 -1
- package/build/dist/chunks/{WGL46F3S.js → WU7XIAXB.js} +1 -1
- package/build/dist/chunks/{5OKJEGBH.js → WV3A3OUU.js} +1 -1
- package/build/dist/chunks/{4ISR2U72.js → X2KFXCVD.js} +1 -1
- package/build/dist/chunks/{RPNAFUM5.js → X3BYCOWS.js} +1 -1
- package/build/dist/chunks/{6L5KTE6Y.js → X3PQMS4N.js} +1 -1
- package/build/dist/chunks/{RNC463IM.js → XBE3B6Y2.js} +1 -1
- package/build/dist/chunks/XLOYBLFI.js +1 -0
- package/build/dist/chunks/{2ZUP7ZEV.js → XR7VK24E.js} +1 -1
- package/build/dist/chunks/{ZSQOMSOC.js → Y25EXZCO.js} +1 -1
- package/build/dist/chunks/{TJWVY4VO.js → YCZPSMZ5.js} +1 -1
- package/build/dist/chunks/{JZXYLHI7.js → YDNTY67T.js} +1 -1
- package/build/dist/chunks/{2DUCTO5C.js → YN56C7PN.js} +1 -1
- package/build/dist/chunks/{G7XSFUDL.js → YWRDZQI6.js} +1 -1
- package/build/dist/chunks/{DP2NIYBP.js → YXTSWRV5.js} +1 -1
- package/build/dist/chunks/{I6KUORFT.js → Z43BTOTE.js} +1 -1
- package/build/dist/chunks/{PWH464CJ.js → Z4FZVJ5Z.js} +1 -1
- package/build/dist/chunks/{YAJYDD6C.js → ZMFRMWHR.js} +1 -1
- package/build/dist/chunks/{OFI3Y55L.js → ZQAFFWDK.js} +1 -1
- package/build/dist/chunks/{TBIVTEP5.js → ZSN4IRI5.js} +1 -1
- package/build/dist/chunks/{ZET37EIG.js → ZV5HIQXC.js} +1 -1
- package/package.json +1 -1
- package/build/dist/chunks/24CQ2SPB.js +0 -1
- package/build/dist/chunks/2OJAOVMG.js +0 -1
- package/build/dist/chunks/65EQECL3.js +0 -1
- package/build/dist/chunks/6YYCGUCU.js +0 -1
- package/build/dist/chunks/EU3OAJU2.js +0 -1
- package/build/dist/chunks/H4NYYJ3Z.js +0 -1
- package/build/dist/chunks/JG27HM4P.js +0 -1
- package/build/dist/chunks/L6D26AMO.js +0 -1
- package/build/dist/chunks/O6L4BJP4.js +0 -1
- package/build/dist/chunks/SUFA2GKR.js +0 -1
- package/build/dist/chunks/UP7FBDMJ.js +0 -1
- package/build/dist/chunks/YHRUAQQK.js +0 -1
- package/build/dist/chunks/ZCUXM52B.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,i as S,l as O,m as R,n as $}from"./
|
|
1
|
+
import{c as k,i as S,l as O,m as R,n as $}from"./NWNYJ26T.js";import{a as f,i as P}from"./FWD4L3CJ.js";import{a as c}from"./XSD5NL7J.js";import{a as A}from"./JXOEJPJ4.js";import{encodeFunctionData as x,erc20Abi as E,parseAbi as U,zeroAddress as j}from"viem";var g=P[f].merkl.distributor.address,H=["function accessControlManager() view returns (address)","function isGovernor(address) view returns (bool)","function isGovernorOrGuardian(address) view returns (bool)","function canUpdateMerkleRoot(address) view returns (uint256)","function mainOperators(address,address) view returns (uint256)","function disputeToken() view returns (address)","function disputeAmount() view returns (uint256)","function disputer() view returns (address)","function endOfDisputePeriod() view returns (uint48)","function getMerkleRoot() view returns (bytes32)","function getEpochDuration() view returns (uint32)","function disputePeriod() view returns (uint48)","function upgradeabilityDeactivated() view returns (uint256)","function disputeTree(string)","function updateTree((bytes32 merkleRoot,bytes32 ipfsHash))","function toggleTrusted(address)","function toggleMainOperatorStatus(address,address)","function revokeUpgradeability()","function setEpochDuration(uint32)","function resolveDispute(bool)","function revokeTree()","function recoverERC20(address,address,uint256)","function setDisputePeriod(uint48)","function setDisputeToken(address)","function setDisputeAmount(uint256)"],y=U(H),F={type:"string",pattern:"^\\d+$"},C={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},G="Provide a valid address.";function m(o,l=!1){let n=S(o,G);return l?n:O(n,G)}function _(o,l=256){return $(o,`Value exceeds uint${l}.`,{bits:l})}function b(o){return R(o,"Merkl returned invalid protocol state.")}function I(o){return typeof o=="number"&&Number.isSafeInteger(o)&&o>=0?String(o):b(o).toString()}var D={updateTree:["merkleRoot","ipfsHash"],toggleTrusted:["target","enabled"],toggleMainOperatorStatus:["target","token","enabled"],revokeUpgradeability:[],setEpochDuration:["amount"],resolveDispute:["valid"],revokeTree:[],recoverERC20:["token","recipient","amount"],setDisputePeriod:["amount"],setDisputeToken:["token"],setDisputeAmount:["amount"]},K=o=>{let l=()=>o.clientFor(f),n=(r,i=[],e=g)=>l().readContract({address:e,abi:y,functionName:r,args:i}),h=(r,i,e,p)=>({name:`merkl_${r}`,inputSchema:{type:"object",properties:i,required:e,additionalProperties:!1},execute:async(u,s)=>{try{let a=Object.keys(u).find(d=>!Object.hasOwn(i,d));if(a)throw new c(`Unsupported Merkl input: ${a}.`);return await p(u,m(s))}catch(a){throw new c(o.plainError(a))}}}),z=async(r,i,e,p)=>{let u=[o.unsignedTx({to:g,data:x({abi:y,functionName:r,args:i}),value:"0",chainId:f,description:e})],s=await o.preview(u,p);return{txs:u,preview:s,summary:`Powered by Merkl \u2014 https://app.merkl.xyz. ${e} ${s.summary}`}};return{tools:[h("distributor_status",{},[],async(r,i)=>{let[e,p,u,s,a,d,t,w,N]=await Promise.all([n("getMerkleRoot"),n("disputeToken"),n("disputeAmount"),n("disputer"),n("endOfDisputePeriod"),n("getEpochDuration"),n("disputePeriod"),n("upgradeabilityDeactivated"),n("accessControlManager")]);if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e)||typeof d!="number"||!Number.isInteger(d)||d<0||d>4294967295)throw new c("Merkl returned invalid Distributor state.");let v=m(N),[M,T]=await Promise.all([n("isGovernor",[i],v),n("isGovernorOrGuardian",[i],v)]);if(typeof M!="boolean"||typeof T!="boolean")throw new c("Merkl returned invalid governance roles.");return{chainId:f,distributor:g,root:e,disputeToken:m(p,!0),disputeAmount:b(u).toString(),disputer:m(s,!0),endOfDisputePeriod:I(a),epochDuration:String(d),disputePeriod:I(t),upgradeabilityDeactivated:b(w).toString(),accessControlManager:v,governor:M,governorOrGuardian:T,summary:"Powered by Merkl \u2014 https://app.merkl.xyz. Dispute amounts are token base units. Opening a dispute locks collateral until governor resolution; a rejected dispute forfeits it."}}),h("dispute",{reason:{type:"string",minLength:1,maxLength:2e3}},["reason"],async(r,i)=>{if(typeof r.reason!="string"||!r.reason.trim()||r.reason.length>2e3)throw new c("Provide a public dispute reason of 1 to 2000 characters.");let e=m(await n("disputeToken")),p=b(await n("disputeAmount")),[u,s]=await Promise.all([l().readContract({address:e,abi:E,functionName:"symbol"}),l().readContract({address:e,abi:E,functionName:"decimals"})]);if(typeof u!="string"||!u.trim()||typeof s!="number"||!Number.isInteger(s)||s<0||s>255)throw new c("Merkl dispute token metadata is invalid.");let a=`Dispute Merkl's tree: ${r.reason}. Lock ${p} ${A(u)} base units (token ${e}, decimals ${s}) until governor resolution; rejection forfeits the deposit. There is no unilateral withdrawal.`,d=[...p?[o.approval(e,g,p.toString(),f)]:[],o.unsignedTx({to:g,data:x({abi:y,functionName:"disputeTree",args:[r.reason]}),value:"0",chainId:f,description:a})],t=await o.preview(d,i);return{txs:d,preview:t,deposit:{token:{address:e,symbol:u,decimals:s,chainId:f},amount:p.toString()},summary:`Powered by Merkl \u2014 https://app.merkl.xyz. ${a} ${t.summary}`}}),h("distributor_admin",{operation:{enum:Object.keys(D)},target:k,token:k,recipient:k,amount:F,enabled:{type:"boolean"},valid:{type:"boolean"},merkleRoot:C,ipfsHash:C},["operation"],async(r,i)=>{let e=String(r.operation);if(!Object.hasOwn(D,e))throw new c("Choose a supported Distributor operation.");let p=D[e];for(let t of Object.keys(r))if(t!=="operation"&&!p.includes(t))throw new c(`Input ${t} does not match this Distributor operation.`);let u=m(await n("accessControlManager")),s=await n("isGovernor",[i],u);if(typeof s!="boolean")throw new c("Merkl returned invalid governor status.");if(!s&&!(e==="updateTree"?await n("canUpdateMerkleRoot",[i])===1n:e==="toggleMainOperatorStatus"&&r.token!==j?await n("isGovernorOrGuardian",[i],u)===!0:!1))throw new c("The connected wallet lacks the required Merkl governance role.");let a=p.map(t=>{if(t==="enabled"||t==="valid"){if(typeof r[t]!="boolean")throw new c(`Provide ${t} as boolean.`);return r[t]}if(t==="amount"){let w=_(r[t],e==="setEpochDuration"?32:e==="setDisputePeriod"?48:256);return e==="setEpochDuration"?Number(w):w}if(t==="merkleRoot"||t==="ipfsHash"){if(typeof r[t]!="string"||!/^0x[0-9a-fA-F]{64}$/.test(r[t]))throw new c("Provide a bytes32 root and IPFS hash.");return r[t]}return m(r[t],t==="token"&&e==="toggleMainOperatorStatus")}),d=a;if(e==="updateTree"&&(d=[{merkleRoot:a[0],ipfsHash:a[1]}]),e==="toggleTrusted"||e==="toggleMainOperatorStatus"){let t=await n(e==="toggleTrusted"?"canUpdateMerkleRoot":"mainOperators",e==="toggleTrusted"?[a[0]]:a.slice(0,2));if(t!==0n&&t!==1n)throw new c("Merkl returned invalid authorization state.");if(t===1n===r.enabled)return{txs:[],summary:"Powered by Merkl \u2014 https://app.merkl.xyz. Authorization already has the requested state."};d=a.slice(0,-1)}return z(e,d,`Merkl Distributor ${e} ${JSON.stringify(r)}. Governance affects every claimant. Upgradeability revocation is permanent; dispute resolution returns or forfeits collateral. Authorization operations toggle the observed state; re-preview if state changes.`,i)})]}};export{K as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n,b as o,c,g as b,h as i}from"./2MZXTOZU.js";import{e as m,h as t}from"./
|
|
1
|
+
import{a as n,b as o,c,g as b,h as i}from"./2MZXTOZU.js";import{e as m,h as t}from"./NWNYJ26T.js";import{a as d}from"./FWD4L3CJ.js";import{a}from"./XSD5NL7J.js";var p="LayerBank's setup no longer matches what Oak checked. Nothing was signed.";async function C(r,u){try{if(await r.getChainId()!==d)throw new a("LayerBank requires chain 4663.");let e=u??await r.getBlockNumber({cacheTime:0}),[l,k,f,s]=await Promise.all([r.readContract({address:o,abi:i,functionName:"POOL",blockNumber:e}),r.readContract({address:o,abi:i,functionName:"UNDERLYING_ASSET_ADDRESS",blockNumber:e}),r.readContract({address:o,abi:i,functionName:"decimals",blockNumber:e}),r.readContract({address:n,abi:b,functionName:"getReserveData",args:[c.address],blockNumber:e})]);if(!t(l,n)||!t(k,c.address)||f!==6||!m(s)||!t(s.aTokenAddress,o))throw new a(p);return s}catch(e){throw e instanceof a?e:new a("LayerBank setup could not be read. Please try again.")}}export{p as a,C as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Ae,o as ce}from"./GHPREYQK.js";import{a as ae}from"./HTXKERNS.js";import{b as xe}from"./Z4SRGAVL.js";import{a as Ie}from"./BQICZFLR.js";import{a as Te}from"./5ZLOCQA4.js";import{e as W,g as p,i as be,n as ke}from"./5KUWLUPM.js";import{a as x,i as ye}from"./FWD4L3CJ.js";import{a}from"./XSD5NL7J.js";import{a as re}from"./JXOEJPJ4.js";import{decodeErrorResult as He,decodeEventLog as ie,encodeAbiParameters as D,encodeFunctionData as N,erc20Abi as Q,parseAbi as Ce,parseAbiParameters as q,toHex as ve,zeroAddress as $}from"viem";var h=ye[x].poolsTrade,J=h.liquidityLauncher.address,C=h.uerc20BeneficiaryVault.address,de=h.universalRouter.address,ne=10n**27n,U=(1n<<128n)-1n,Ne=`0x${"00".repeat(32)}`,R=63127652n,ue=100000n,oe=10000000n,Re=2000n,le={address:ae,symbol:"ETH",decimals:18,chainId:x},m=Ce(["function multicall(bytes[] data) payable returns (bytes[])","function createToken(address factory,string name,string symbol,uint8 decimals,uint128 initialSupply,address recipient,bytes tokenData) payable returns (address)","function distributeToken(address token,(address strategy,uint128 amount,bytes configData) distribution,bytes32 salt) payable","function distributeWithNative(address strategy,bytes configData,bytes32 salt,uint256 nativeAmount) payable","function getGraffiti(address sender) view returns (bytes32)","function getUERC20Address(string name,string symbol,uint8 decimals,address recipient,bytes32 graffiti) view returns (address)","function execute(bytes commands,bytes[] inputs,uint256 deadline) payable","function collectFees(uint256[] ids)","function claim(uint256 id,uint256 minCurrency0Amount,uint256 minCurrency1Amount)","function amounts(uint256 id) view returns (uint128 eth,uint128 token)","function ownerOf(uint256 id) view returns (address)","function getApproved(uint256 id) view returns (address)","function approve(address spender,uint256 id)","function safeTransferFrom(address from,address to,uint256 id)","function approve(address token,address spender,uint160 amount,uint48 expiration)","error V4TooLittleReceived(uint256 minAmountOut,uint256 amountOut)"]),z=Ce(["event TokenLaunched(bytes32 indexed poolId,address indexed token,address indexed feeSplitter,(address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey)","event Transfer(address indexed from,address indexed to,uint256 indexed tokenId)"]),j=[h.instantLaunchStrategyFeesOn.address,h.instantLaunchStrategyFeesOff.address];function se(l){if(l.status!=="success")throw new a("The launch receipt did not succeed.");let c=[];for(let y of l.logs){let O=j.findIndex(F=>p(F,y.address));if(O===-1||y.topics[0]!=="0x3b3d2bafdcae274a232217e1f80ee4305d3af6aa25c8b14b1681bd68d18042a4")continue;let V=ie({abi:z,eventName:"TokenLaunched",data:y.data,topics:[...y.topics]}),{token:T,poolId:Y,poolKey:M,feeSplitter:Z}=V.args,_=O===0?h.feeSplitterFeesOn.address:h.feeSplitterFeesOff.address;if(!p(Z,_)||!p(M.currency0,$)||!p(M.currency1,T)||M.fee!==2500||M.tickSpacing!==25||!p(M.hooks,$))throw new a("The launch does not match the current native ETH strategy.");let ee=l.logs.filter(F=>p(F.address,h.v4PositionManager.address)).flatMap(F=>{if(F.topics[0]!=="0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef")return[];let P=ie({abi:z,eventName:"Transfer",data:F.data,topics:[...F.topics]}).args;return p(P.from,$)&&p(P.to,j[O])?[P.tokenId]:[]});if(ee.length!==1)throw new a("The launch receipt must identify one matching position mint.");c.push({token:T,poolId:Y,positionId:ee[0].toString(),creatorFees:O===0})}return c}function S(l){return be(l,"Provide a valid wallet or token address.")}function L(l,c,y=!1){return ke(l,`${c} is outside its supported range.`,{notString:`${c} must be an integer string in base units.`,positive:!y})}function X(l,c,y=!1){if(y&&l===void 0)return"";if(typeof l!="string"||!y&&!l.trim()||l.length>4096)throw new a(`Provide a valid ${c}.`);return l}function fe(l){if(typeof l!="string"||!/^0x[0-9a-fA-F]{64}$/.test(l))throw new a("Provide a valid launch transaction hash.");return l}function pe(l,c,y="minAmountOut"){let O=c.slippageBps??Ae;if(typeof O!="number")throw new a("Slippage must be an integer in basis points.");let V=ce(l.toString(),O),T=c[y]===void 0?BigInt(V):L(c[y],y,l===0n);if(T>l||l>0n&&T===0n||T>U)throw new a("The minimum output must be positive and no larger than the simulated output.");return T}var Me=l=>{let c=l.clientFor(x),y=(e,s,o,n)=>l.unsignedTx({to:e,data:s,value:o.toString(),chainId:x,description:n}),O=e=>{throw new a(l.plainError(e))};async function V(){if(await c.getChainId()!==x)throw new a("pools.trade requires Robinhood Chain 4663.")}async function T(e,s,o){let n=await l.preview(e,s),t=n.changes.map(({token:r,amount:d})=>{let i=d.startsWith("-");return`${i?"-":""}${l.formatAmount(i?d.slice(1):d,r.decimals)} ${re(r.symbol)} (${r.address}, chain ${r.chainId})`});return{txs:e,summary:[o,n.summary,...t].join(" ")}}async function Y(){return(await c.getBlock()).timestamp+600n}function M(e,s,o,n,t,r){let d=[$,e,2500,25,$],i=[D(q("((address,address,uint24,int24,address),bool,uint128,uint128,uint256,bytes)"),[[d,s,o,n,0n,"0x"]]),D(q("address,uint256"),[s?$:e,o]),D(q("address,address,uint256"),[s?e:$,t,0n])],f=[D(q("bytes,bytes[]"),["0x060c0e",i])];return{inputs:f,encoded:D(q("bytes,bytes[],uint256"),["0x10",f,r])}}async function Z(e,s){let o=await c.request({method:"eth_simulateV1",params:[{blockStateCalls:[{calls:e.map(i=>({from:s,gas:ve(Ie),to:i.to,data:i.data,value:ve(BigInt(i.value))}))}],validation:!1,traceTransfers:!1},"latest"]},{retryCount:0});if(!Array.isArray(o)||o.length!==1||!W(o[0])||!Array.isArray(o[0].calls)||o[0].calls.length!==e.length)throw new a("The output simulation returned a malformed response.");let n=o[0].calls;if(!n.slice(0,-1).every(i=>W(i)&&i.status==="0x1"&&!i.error))throw new a("A prerequisite failed during the output simulation.");let t=n.at(-1);if(!W(t)||t.status!=="0x0")throw new a("The output simulation did not return the expected minimum-output control.");let r=typeof t.returnData=="string"&&t.returnData!=="0x"?t.returnData:W(t.error)?t.error.data:void 0;if(typeof r!="string"||!/^0x[0-9a-fA-F]+$/.test(r))throw new a("The output simulation did not report an expected amount.");let d=He({abi:m,data:r});if(d.errorName!=="V4TooLittleReceived"||d.args[0]!==U||d.args[1]<=0n||d.args[1]>=U)throw new a("The output simulation did not report a valid amount.");return d.args[1]}let _=new Map,ee=2e3;async function F(e,s,o,n=()=>!0){let t=await c.getBlockNumber(),r=t<R?0n:(t-R)/oe+1n,d=1n,i=(u=1n)=>{if(d+=u,d>Re)throw new a("Pools.trade scan exceeds the 2000-request limit. Use launchTx for a specific launch; positions coverage is incomplete.")};i(r*BigInt(j.length+(e&&!o?1:0)));let f=new Map,w=new Set;for(let u=R;u<=t&&n();u+=oe){let b=u+oe-1n>t?t:u+oe-1n,v=(await Promise.all(j.map(k=>c.getLogs({address:k,event:z[0],...s?{args:{token:s}}:{},fromBlock:u,toBlock:b,strict:!0})))).flat(),E=[...new Set(v.map(k=>k.transactionHash))].filter(k=>!k||!f.has(k));for(let k=0;k<E.length&&n();k+=8)await Promise.all(E.slice(k,k+8).map(async B=>{if(!B)throw new a("A launch log is missing its transaction hash.");let H=_.get(B);H||(i(),H=await c.getTransactionReceipt({hash:B}),_.size>=ee&&_.delete(_.keys().next().value),_.set(B,H)),f.set(B,H),n()&&await o?.(H)}));if(!n())break;if(e&&!o){let k=await c.getLogs({address:C,event:z[1],args:{to:e},fromBlock:u,toBlock:b,strict:!0});for(let B of k){let H=ie({abi:z,eventName:"Transfer",data:B.data,topics:B.topics}).args;w.add(H.tokenId.toString())}}}return{receipts:[...f.values()],feeIds:w}}async function P(e){let o=(e.launchTx!==void 0?[await c.getTransactionReceipt({hash:fe(e.launchTx)})]:(await F(void 0,e.token===void 0?void 0:S(e.token))).receipts).flatMap(se).filter(n=>e.positionId!==void 0?n.positionId===L(e.positionId,"positionId").toString():p(n.token,S(e.token)));if(o.length!==1)throw new a("No unique current-strategy launch was found. Older strategy generations are unsupported.");return o[0]}async function Se(e,s){if(typeof e.creatorFees!="boolean")throw new a("creatorFees must be an explicit boolean; the choice is permanent.");if(e.pair!==void 0&&!p(S(e.pair),$)&&!p(S(e.pair),ae))throw new a("Only the native ETH pair is supported.");if(e.decimals!==void 0&&e.decimals!==18)throw new a("Instant Launch requires 18 decimals.");if(e.supply!==void 0&&L(e.supply,"supply")!==ne)throw new a("Instant Launch requires a supply of one billion tokens.");let o=S(e.feeBeneficiary);if(p(o,$)||p(o,J))throw new a("The fee beneficiary must be a wallet other than the launcher or zero address.");let n=X(e.name,"name"),t=X(e.symbol,"symbol"),r=e.initialBuy===void 0?0n:L(e.initialBuy,"initialBuy",!0);if(r>U)throw new a("The initial buy exceeds uint128.");if(r===0n&&e.minAmountOut!==void 0)throw new a("A minimum output requires an initial buy.");let d=await c.readContract({address:J,abi:m,functionName:"getGraffiti",args:[s]}),i=S(await c.readContract({address:h.uerc20Factory.address,abi:m,functionName:"getUERC20Address",args:[n,t,18,J,d]})),f=await c.getCode({address:i});if(f&&f!=="0x")throw new a("This wallet already launched that name and symbol.");let w=D(q("(string,string,string,bytes)"),[[X(e.description,"description",!0),X(e.website,"website",!0),X(e.imageUri,"image URI",!0),"0x"]]),u=e.creatorFees?j[0]:j[1],b=[N({abi:m,functionName:"createToken",args:[h.uerc20Factory.address,n,t,18,ne,J,w]}),N({abi:m,functionName:"distributeToken",args:[i,{strategy:u,amount:ne,configData:D(q("address"),[o])},Ne]})],v=await Y(),G=k=>{let B=[...b];if(r>0n){let H=D(q("(address,address,bytes)"),[[de,s,M(i,!0,r,k,s,v).encoded]]);B.push(N({abi:m,functionName:"distributeWithNative",args:[h.universalRouterStrategyApp.address,H,Ne,r]}))}return y(J,N({abi:m,functionName:"multicall",args:[B]}),r,`Atomic Instant Launch: creator fees ${e.creatorFees?"on":"off"} (permanent); beneficiary ${o}.`)},E=r>0n?pe(await Z([G(U)],s),e):0n;return T([G(E)],s,`Launch ${n} (${i}, chain 4663), supply 1000000000, decimals 18. Creator fees ${e.creatorFees?"on":"off"} are permanent; fee beneficiary ${o}. Creator ETH fees come from buys only (recorded 0.09996%); sells compound into locked liquidity. Initial-buy minimum ${E} token base units. Off-chain image/display unproven; no private metadata registration. No transaction sent.`)}async function Be(e,s,o){let n=L(e.amountIn,"amountIn");if(n>U)throw new a("The trade amount exceeds uint128.");let t=S(e.token);await P(e);let r=await Y(),d=[];o||(await c.readContract({address:t,abi:Q,functionName:"allowance",args:[s,h.permit2.address]})<n&&d.push(l.approval(t,h.permit2.address,n.toString(),x)),d.push(y(h.permit2.address,N({abi:m,functionName:"approve",args:[t,de,n,Number(r)]}),0n,`Permit the exact ${n} token base units until ${r}.`)));let i=u=>[...d,y(de,N({abi:m,functionName:"execute",args:["0x10",M(t,o,n,u,s,r).inputs,r]}),o?n:0n,`${o?"Buy":"Sell"} ${t} with minimum output ${u}.`)],f=await Z(i(U),s),w=pe(f,e);return T(i(w),s,`${o?"Buy":"Sell"} token ${t} (chain 4663, 18 decimals), amountIn ${n}, minimum output ${w} ${o?"token":"ETH"} base units (18 decimals). Recorded swap fee 0.2899%; creator ETH fees from buys only, none from sells. No transaction sent.`)}async function me(e,s,o){let n=await P(e),t=BigInt(n.positionId),r=n.creatorFees?h.feeSplitterFeesOn.address:h.feeSplitterFeesOff.address,d=await c.readContract({address:h.v4PositionManager.address,abi:m,functionName:"ownerOf",args:[t]});if(!p(d,r))throw new a("The position is not locked in its current-strategy splitter.");if(!o)return T([y(r,N({abi:m,functionName:"collectFees",args:[[t]]}),0n,`Collect fees for position ${t}; permissionless.`)],s,"Collect fees for the entitled recipients; collection does not transfer creator fees to the collector. No transaction sent.");if(!n.creatorFees)throw new a("Creator fees are permanently disabled for this position.");let i=await c.readContract({address:C,abi:m,functionName:"ownerOf",args:[t]});if(!p(i,s))throw new a("Only the current fee NFT holder is entitled to claim.");let f=await c.readContract({address:C,abi:m,functionName:"amounts",args:[t]}),w=pe(f[0],e,"minEth");if(f[1]!==0n)throw new a("The current buy-only creator fee configuration returned unexpected token fees.");return T([y(C,N({abi:m,functionName:"claim",args:[t,w,0n]}),0n,`Claim collected ETH fees for position ${t} to ${s}.`)],s,`Claim collected fees: ${f[0]} ETH base units (18 decimals), minimum ${w}. Uncollected fees require poolstrade_collect first. No transaction sent.`)}async function $e(e,s){let o=await P(e),n=S(e.to);if(p(n,$))throw new a("The token recipient cannot be the zero address.");let t=L(e.amount,"amount"),r=await te(o.token,await c.getBlockNumber());return T([y(r.address,N({abi:Q,functionName:"transfer",args:[n,t]}),0n,`Transfer exactly ${t} ${re(r.symbol)} base units to ${n}.`)],s,`Transfer ${t} token base units (token ${r.address}, decimals ${r.decimals}, chain ${r.chainId}) to ${n}. No approval; no transaction sent.`)}async function Fe(e,s){if(!Array.isArray(e.positionIds)||e.positionIds.length<1||e.positionIds.length>20||!Array.isArray(e.launchTxs)||e.launchTxs.length!==e.positionIds.length)throw new a("Provide 1 to 20 positionIds and one matching launchTxs entry for each.");let o=e.positionIds.map(d=>L(d,"positionId").toString());if(new Set(o).size!==o.length)throw new a("Each position ID must appear once.");let n=e.launchTxs.map(fe),t=new Map;for(let[d,i]of o.entries()){let w=(await P({positionId:i,launchTx:n[d]})).creatorFees?h.feeSplitterFeesOn.address:h.feeSplitterFeesOff.address,u=BigInt(i),b=await c.readContract({address:h.v4PositionManager.address,abi:m,functionName:"ownerOf",args:[u]});if(!p(b,w))throw new a("The position is not locked in its current-strategy splitter.");t.set(w,[...t.get(w)??[],u])}let r=[...t].map(([d,i])=>y(d,N({abi:m,functionName:"collectFees",args:[i]}),0n,`Collect fees for positions ${i.join(", ")}; permissionless.`));return T(r,s,"Collect fees in batches for the fixed entitled recipients. Collection does not pay the collector. No transaction sent.")}let K="Current native ETH Instant Launch strategies only. Crowd Launch and older deployments are not covered.";async function te(e,s){let[o,n]=await Promise.all([c.readContract({address:e,abi:Q,functionName:"symbol",blockNumber:s}),c.readContract({address:e,abi:Q,functionName:"decimals",blockNumber:s})]);if(typeof o!="string"||!o||o.length>256||n!==18)throw new a("The current launch token returned invalid metadata.");return{address:e,symbol:o,decimals:n,chainId:x}}async function he(e,s,o,n){let t=n??await te(e.token,o),r=await c.readContract({address:t.address,abi:Q,functionName:"balanceOf",args:[s],blockNumber:o});return{token:t,amount:r.toString(),humanAmount:l.formatAmount(r.toString(),t.decimals)}}async function Pe(e,s){let o=await P(e),n=await c.getBlockNumber();return{wallet:s,...await he(o,s,n),blockNumber:n.toString(),coverage:K}}async function Le(e,s){let o=fe(e.launchTx),n=await c.getTransactionReceipt({hash:o}),t=se(n);if(e.token!==void 0&&(t=t.filter(i=>p(i.token,S(e.token)))),e.positionId!==void 0&&(t=t.filter(i=>i.positionId===L(e.positionId,"positionId").toString())),!t.length)throw new a("The receipt contains no matching current Instant Launch. Crowd Launch and older strategies are not covered.");let r=await c.getBlockNumber(),d=await Promise.all(t.map(async i=>{let f=i.creatorFees?h.feeSplitterFeesOn.address:h.feeSplitterFeesOff.address,w=await c.readContract({address:h.v4PositionManager.address,abi:m,functionName:"ownerOf",args:[BigInt(i.positionId)],blockNumber:r});if(!p(w,f))throw new a("The position is not locked in its current-strategy splitter.");let u=i.creatorFees?{owner:await c.readContract({address:C,abi:m,functionName:"ownerOf",args:[BigInt(i.positionId)],blockNumber:r}),approved:await c.readContract({address:C,abi:m,functionName:"getApproved",args:[BigInt(i.positionId)],blockNumber:r}),collected:await c.readContract({address:C,abi:m,functionName:"amounts",args:[BigInt(i.positionId)],blockNumber:r})}:void 0,b=await te(i.token,r);return{...i,token:b,custodian:w,holding:await he(i,s,r,b),...u?{feeEntitlement:{owner:u.owner,approved:u.approved,collected:[{token:le,amount:u.collected[0].toString()},{token:b,amount:u.collected[1].toString()}],uncollectedFeesIncluded:!1}}:{}}}));return{launchTx:o,wallet:s,creator:n.from,blockNumber:r.toString(),launches:d,coverage:K}}async function Oe(e){let s=await c.getBlockNumber(),o=e.limit??20;if(typeof o!="number"||!Number.isInteger(o)||o<1||o>50)throw new a("limit must be an integer from 1 to 50.");let n=e.fromBlock===void 0?s>=R+ue?s-ue+1n:R:L(e.fromBlock,"fromBlock",!0),t=e.toBlock===void 0?s:L(e.toBlock,"toBlock",!0),r=0;if(e.cursor!==void 0){if(typeof e.cursor!="string"||!/^[0-9]{1,78}:[0-9]{1,78}:[0-9]{1,10}$/.test(e.cursor))throw new a("Provide the browse cursor exactly as returned.");let u=e.cursor.split(":"),b=BigInt(u[0]),v=BigInt(u[1]);if(e.fromBlock!==void 0&&n!==b||e.toBlock!==void 0&&t!==v)throw new a("The cursor does not match this block range.");n=b,t=v,r=Number(u[2])}if(s<R&&e.fromBlock===void 0&&e.toBlock===void 0&&e.cursor===void 0)return{launches:[],cursor:null,fromBlock:R.toString(),toBlock:s.toString(),coverage:K,predeployment:!0};if(n<R||t<n||t>s||t-n>=ue)throw new a("Choose a deployed block range of at most 100000 blocks, ending no later than the current head.");let d=await c.getLogs({address:j,event:z[0],fromBlock:n,toBlock:t,strict:!0});if(d.some(u=>u.blockNumber===null||u.logIndex===null||!u.transactionHash))throw new a("The launch feed returned an incomplete log.");if(d.sort((u,b)=>u.blockNumber===b.blockNumber?b.logIndex-u.logIndex:u.blockNumber>b.blockNumber?-1:1),r>d.length)throw new a("The browse cursor is outside the launch feed.");let i=new Map,f=[];for(let u of d.slice(r,r+o)){let b=u.transactionHash,v=i.get(b);v||(v=await c.getTransactionReceipt({hash:b}),i.set(b,v));let G=ie({abi:z,eventName:"TokenLaunched",data:u.data,topics:u.topics}).args,E=se(v).filter(k=>p(k.token,G.token)&&p(k.poolId,G.poolId));if(E.length!==1)throw new a("The launch feed log does not match one verified receipt launch.");f.push({...E[0],launchTx:b,blockNumber:u.blockNumber.toString(),token:await te(E[0].token,t),creator:v.from})}let w=r+o;return{launches:f,cursor:w<d.length?`${n}:${t}:${w}`:null,fromBlock:n.toString(),toBlock:t.toString(),coverage:K,previousToBlock:n>R?(n-1n).toString():null,summary:"Newest launches first within this fixed block range. Empty does not establish absence outside the range or covered strategies."}}async function ge(e,s,o){let n=await P(e);if(!n.creatorFees)throw new a("Creator fees are permanently disabled for this position.");let t=BigInt(n.positionId),r=await c.readContract({address:h.v4PositionManager.address,abi:m,functionName:"ownerOf",args:[t]});if(!p(r,h.feeSplitterFeesOn.address))throw new a("The position is not locked in its current-strategy splitter.");let d=await c.readContract({address:C,abi:m,functionName:"ownerOf",args:[t]});if(!p(d,s))throw new a("Only the current fee NFT holder can change this entitlement.");let i=S(o?e.to:e.spender);if(p(i,C)||o&&p(i,$))throw new a("The fee NFT recipient cannot be the vault or zero address.");let f=o?N({abi:m,functionName:"safeTransferFrom",args:[s,i,t]}):N({abi:m,functionName:"approve",args:[i,t]});return T([y(C,f,0n,o?`Transfer fee NFT ${t} to ${i}, including accrued and future fees.`:`Approve ${i} for fee NFT ${t} only; zero address revokes approval.`)],s,o?`Transfer the entire fee entitlement for position ${t} to ${i}. This includes collected and future fees; locked LP remains in its splitter. No transaction sent.`:`Set the exact single-NFT approval for position ${t} to ${i}. This permits transfer of that fee entitlement; zero address revokes. No transaction sent.`)}async function Ee(){return{chainId:x,instant:{supported:!0,supply:ne.toString(),decimals:18,currency:le,permanentCreatorFeeChoice:!0},crowd:{status:"BLOCKED",strategy:"0xbf1aB81f7d534b2CC0Da76fcf4d541322bB0e000",factory:"0x000000001F26a0044BaA66024e7b6599c61963F8",missing:"A verified Pools-specific auction configuration (BlockNumberish timing, reserve allocation, Q96 floor/tick, USD FDV conversion, issuance steps, locked LP plan) and a bytecode-matched factory-created auction ABI with success/refund fixtures. Generic CCA parameters are not a verified Pools Crowd Launch.",source:"https://github.com/Uniswap/sdks/blob/main/sdks/liquidity-launcher-sdk/src/addresses.ts"},coverage:K}}let g={type:"string"},I=Te(),we={chainId:{type:"integer",const:x},slippageBps:{type:"integer",minimum:0,maximum:9999}};function A(e,s,o,n){return{name:`poolstrade_${e}`,inputSchema:{type:"object",additionalProperties:!1,properties:{...we,...s},required:o},execute:async(t,r)=>{try{let d=new Set([...Object.keys(we),...Object.keys(s)]);if(Object.keys(t).some(i=>!d.has(i)))throw new a("Unsupported input for this pools.trade tool.");if(t.chainId!==void 0&&t.chainId!==x)throw new a("pools.trade requires chain 4663.");if(S(r),t.slippageBps!==void 0){if(typeof t.slippageBps!="number")throw new a("Slippage must be an integer in basis points.");ce("10000",t.slippageBps)}return await V(),await n(t,r)}catch(d){O(d)}}}}return{tools:[A("launch",{name:g,symbol:g,creatorFees:{type:"boolean",description:"Permanent choice; must be explicit."},feeBeneficiary:g,pair:g,decimals:{type:"integer",const:18},supply:I,initialBuy:I,minAmountOut:I,description:g,website:g,imageUri:g},["name","symbol","creatorFees","feeBeneficiary"],Se),...["buy","sell"].map(e=>A(e,{token:g,amountIn:I,minAmountOut:I,launchTx:g},["token","amountIn"],(s,o)=>Be(s,o,e==="buy"))),A("collect",{positionId:I,launchTx:g},["positionId"],(e,s)=>me(e,s,!1)),A("claim",{positionId:I,launchTx:g,minEth:I},["positionId"],(e,s)=>me(e,s,!0)),A("browse",{fromBlock:I,toBlock:I,limit:{type:"integer",minimum:1,maximum:50},cursor:g},[],Oe),A("balance",{token:g,launchTx:g},["token"],Pe),A("status",{launchTx:g,token:g,positionId:I},["launchTx"],Le),A("launch_options",{},[],Ee),A("fee_transfer",{positionId:I,launchTx:g,to:g},["positionId","to"],(e,s)=>ge(e,s,!0)),A("fee_approve",{positionId:I,launchTx:g,spender:g},["positionId","spender"],(e,s)=>ge(e,s,!1)),A("transfer",{token:g,amount:I,to:g,launchTx:g},["token","amount","to"],$e),A("collect_many",{positionIds:{type:"array",items:I,minItems:1,maxItems:20},launchTxs:{type:"array",items:g,minItems:1,maxItems:20}},["positionIds","launchTxs"],Fe)],positions:async e=>{S(e);let s=[],o=0,n=!0,t,r=i=>({module:"poolstrade",id:"poolstrade-discovery-incomplete",chainId:x,assets:[],incomplete:!0,description:`${i} Checked ${o} launch receipts. Readable holdings are retained. Check a known launch with poolstrade_status {"launchTx":"<hash>"} or its token holding with poolstrade_balance {"token":"<address>","launchTx":"<hash>"}. Crowd Launch and older deployments are outside this reader's coverage.`}),d=async()=>{await V(),n&&await F(e,void 0,async i=>{o++;for(let f of se(i)){if(!n)return;let w=f.creatorFees&&p(await c.readContract({address:C,abi:m,functionName:"ownerOf",args:[BigInt(f.positionId)]}),e);if(!n)return;if(!w&&!p(i.from,e))continue;let u=w?[{token:le,amount:(await c.readContract({address:C,abi:m,functionName:"amounts",args:[BigInt(f.positionId)]}))[0].toString()}]:[];n&&s.push({module:"poolstrade",id:f.positionId,chainId:x,assets:u,description:`Current Instant Launch ${f.token} (18 decimals, supply 1000000000), pool ${f.poolId}; creator fees ${f.creatorFees?"on":"off"} (permanent). ${w?"Collected ETH fees only; uncollected fees excluded.":"Launch record; no fee entitlement held."} Liquidity is permanently locked.`})}},()=>n)};try{return await Promise.race([d().then(()=>!0),new Promise(f=>{t=setTimeout(()=>{n=!1,f(!1)},6e3)})])?s:[...s,r("Pools.trade global launch discovery reached its 6000 ms read budget; the historical scan is incomplete.")]}catch(i){return[...s,r(`Pools.trade discovery could not finish: ${l.plainError(i)}`)]}finally{n=!1,t!==void 0&&clearTimeout(t)}}}};function Qe(l){return xe("poolstrade",[Me(l)])}export{se as a,Me as b,Qe as c};
|
|
1
|
+
import{b as Ae,o as ce}from"./3NJ5KQ3Q.js";import{a as ae}from"./3MLUCYCB.js";import{b as xe}from"./SPJCSEKP.js";import{a as Ie}from"./IOYRL6AY.js";import{a as Te}from"./66F5ZH34.js";import{e as W,g as p,i as be,n as ke}from"./NWNYJ26T.js";import{a as x,i as ye}from"./FWD4L3CJ.js";import{a}from"./XSD5NL7J.js";import{a as re}from"./JXOEJPJ4.js";import{decodeErrorResult as He,decodeEventLog as ie,encodeAbiParameters as D,encodeFunctionData as N,erc20Abi as Q,parseAbi as Ce,parseAbiParameters as q,toHex as ve,zeroAddress as $}from"viem";var h=ye[x].poolsTrade,J=h.liquidityLauncher.address,C=h.uerc20BeneficiaryVault.address,de=h.universalRouter.address,ne=10n**27n,U=(1n<<128n)-1n,Ne=`0x${"00".repeat(32)}`,R=63127652n,ue=100000n,oe=10000000n,Re=2000n,le={address:ae,symbol:"ETH",decimals:18,chainId:x},m=Ce(["function multicall(bytes[] data) payable returns (bytes[])","function createToken(address factory,string name,string symbol,uint8 decimals,uint128 initialSupply,address recipient,bytes tokenData) payable returns (address)","function distributeToken(address token,(address strategy,uint128 amount,bytes configData) distribution,bytes32 salt) payable","function distributeWithNative(address strategy,bytes configData,bytes32 salt,uint256 nativeAmount) payable","function getGraffiti(address sender) view returns (bytes32)","function getUERC20Address(string name,string symbol,uint8 decimals,address recipient,bytes32 graffiti) view returns (address)","function execute(bytes commands,bytes[] inputs,uint256 deadline) payable","function collectFees(uint256[] ids)","function claim(uint256 id,uint256 minCurrency0Amount,uint256 minCurrency1Amount)","function amounts(uint256 id) view returns (uint128 eth,uint128 token)","function ownerOf(uint256 id) view returns (address)","function getApproved(uint256 id) view returns (address)","function approve(address spender,uint256 id)","function safeTransferFrom(address from,address to,uint256 id)","function approve(address token,address spender,uint160 amount,uint48 expiration)","error V4TooLittleReceived(uint256 minAmountOut,uint256 amountOut)"]),z=Ce(["event TokenLaunched(bytes32 indexed poolId,address indexed token,address indexed feeSplitter,(address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey)","event Transfer(address indexed from,address indexed to,uint256 indexed tokenId)"]),j=[h.instantLaunchStrategyFeesOn.address,h.instantLaunchStrategyFeesOff.address];function se(l){if(l.status!=="success")throw new a("The launch receipt did not succeed.");let c=[];for(let y of l.logs){let O=j.findIndex(F=>p(F,y.address));if(O===-1||y.topics[0]!=="0x3b3d2bafdcae274a232217e1f80ee4305d3af6aa25c8b14b1681bd68d18042a4")continue;let V=ie({abi:z,eventName:"TokenLaunched",data:y.data,topics:[...y.topics]}),{token:T,poolId:Y,poolKey:M,feeSplitter:Z}=V.args,_=O===0?h.feeSplitterFeesOn.address:h.feeSplitterFeesOff.address;if(!p(Z,_)||!p(M.currency0,$)||!p(M.currency1,T)||M.fee!==2500||M.tickSpacing!==25||!p(M.hooks,$))throw new a("The launch does not match the current native ETH strategy.");let ee=l.logs.filter(F=>p(F.address,h.v4PositionManager.address)).flatMap(F=>{if(F.topics[0]!=="0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef")return[];let P=ie({abi:z,eventName:"Transfer",data:F.data,topics:[...F.topics]}).args;return p(P.from,$)&&p(P.to,j[O])?[P.tokenId]:[]});if(ee.length!==1)throw new a("The launch receipt must identify one matching position mint.");c.push({token:T,poolId:Y,positionId:ee[0].toString(),creatorFees:O===0})}return c}function S(l){return be(l,"Provide a valid wallet or token address.")}function L(l,c,y=!1){return ke(l,`${c} is outside its supported range.`,{notString:`${c} must be an integer string in base units.`,positive:!y})}function X(l,c,y=!1){if(y&&l===void 0)return"";if(typeof l!="string"||!y&&!l.trim()||l.length>4096)throw new a(`Provide a valid ${c}.`);return l}function fe(l){if(typeof l!="string"||!/^0x[0-9a-fA-F]{64}$/.test(l))throw new a("Provide a valid launch transaction hash.");return l}function pe(l,c,y="minAmountOut"){let O=c.slippageBps??Ae;if(typeof O!="number")throw new a("Slippage must be an integer in basis points.");let V=ce(l.toString(),O),T=c[y]===void 0?BigInt(V):L(c[y],y,l===0n);if(T>l||l>0n&&T===0n||T>U)throw new a("The minimum output must be positive and no larger than the simulated output.");return T}var Me=l=>{let c=l.clientFor(x),y=(e,s,o,n)=>l.unsignedTx({to:e,data:s,value:o.toString(),chainId:x,description:n}),O=e=>{throw new a(l.plainError(e))};async function V(){if(await c.getChainId()!==x)throw new a("pools.trade requires Robinhood Chain 4663.")}async function T(e,s,o){let n=await l.preview(e,s),t=n.changes.map(({token:r,amount:d})=>{let i=d.startsWith("-");return`${i?"-":""}${l.formatAmount(i?d.slice(1):d,r.decimals)} ${re(r.symbol)} (${r.address}, chain ${r.chainId})`});return{txs:e,summary:[o,n.summary,...t].join(" ")}}async function Y(){return(await c.getBlock()).timestamp+600n}function M(e,s,o,n,t,r){let d=[$,e,2500,25,$],i=[D(q("((address,address,uint24,int24,address),bool,uint128,uint128,uint256,bytes)"),[[d,s,o,n,0n,"0x"]]),D(q("address,uint256"),[s?$:e,o]),D(q("address,address,uint256"),[s?e:$,t,0n])],f=[D(q("bytes,bytes[]"),["0x060c0e",i])];return{inputs:f,encoded:D(q("bytes,bytes[],uint256"),["0x10",f,r])}}async function Z(e,s){let o=await c.request({method:"eth_simulateV1",params:[{blockStateCalls:[{calls:e.map(i=>({from:s,gas:ve(Ie),to:i.to,data:i.data,value:ve(BigInt(i.value))}))}],validation:!1,traceTransfers:!1},"latest"]},{retryCount:0});if(!Array.isArray(o)||o.length!==1||!W(o[0])||!Array.isArray(o[0].calls)||o[0].calls.length!==e.length)throw new a("The output simulation returned a malformed response.");let n=o[0].calls;if(!n.slice(0,-1).every(i=>W(i)&&i.status==="0x1"&&!i.error))throw new a("A prerequisite failed during the output simulation.");let t=n.at(-1);if(!W(t)||t.status!=="0x0")throw new a("The output simulation did not return the expected minimum-output control.");let r=typeof t.returnData=="string"&&t.returnData!=="0x"?t.returnData:W(t.error)?t.error.data:void 0;if(typeof r!="string"||!/^0x[0-9a-fA-F]+$/.test(r))throw new a("The output simulation did not report an expected amount.");let d=He({abi:m,data:r});if(d.errorName!=="V4TooLittleReceived"||d.args[0]!==U||d.args[1]<=0n||d.args[1]>=U)throw new a("The output simulation did not report a valid amount.");return d.args[1]}let _=new Map,ee=2e3;async function F(e,s,o,n=()=>!0){let t=await c.getBlockNumber(),r=t<R?0n:(t-R)/oe+1n,d=1n,i=(u=1n)=>{if(d+=u,d>Re)throw new a("Pools.trade scan exceeds the 2000-request limit. Use launchTx for a specific launch; positions coverage is incomplete.")};i(r*BigInt(j.length+(e&&!o?1:0)));let f=new Map,w=new Set;for(let u=R;u<=t&&n();u+=oe){let b=u+oe-1n>t?t:u+oe-1n,v=(await Promise.all(j.map(k=>c.getLogs({address:k,event:z[0],...s?{args:{token:s}}:{},fromBlock:u,toBlock:b,strict:!0})))).flat(),E=[...new Set(v.map(k=>k.transactionHash))].filter(k=>!k||!f.has(k));for(let k=0;k<E.length&&n();k+=8)await Promise.all(E.slice(k,k+8).map(async B=>{if(!B)throw new a("A launch log is missing its transaction hash.");let H=_.get(B);H||(i(),H=await c.getTransactionReceipt({hash:B}),_.size>=ee&&_.delete(_.keys().next().value),_.set(B,H)),f.set(B,H),n()&&await o?.(H)}));if(!n())break;if(e&&!o){let k=await c.getLogs({address:C,event:z[1],args:{to:e},fromBlock:u,toBlock:b,strict:!0});for(let B of k){let H=ie({abi:z,eventName:"Transfer",data:B.data,topics:B.topics}).args;w.add(H.tokenId.toString())}}}return{receipts:[...f.values()],feeIds:w}}async function P(e){let o=(e.launchTx!==void 0?[await c.getTransactionReceipt({hash:fe(e.launchTx)})]:(await F(void 0,e.token===void 0?void 0:S(e.token))).receipts).flatMap(se).filter(n=>e.positionId!==void 0?n.positionId===L(e.positionId,"positionId").toString():p(n.token,S(e.token)));if(o.length!==1)throw new a("No unique current-strategy launch was found. Older strategy generations are unsupported.");return o[0]}async function Se(e,s){if(typeof e.creatorFees!="boolean")throw new a("creatorFees must be an explicit boolean; the choice is permanent.");if(e.pair!==void 0&&!p(S(e.pair),$)&&!p(S(e.pair),ae))throw new a("Only the native ETH pair is supported.");if(e.decimals!==void 0&&e.decimals!==18)throw new a("Instant Launch requires 18 decimals.");if(e.supply!==void 0&&L(e.supply,"supply")!==ne)throw new a("Instant Launch requires a supply of one billion tokens.");let o=S(e.feeBeneficiary);if(p(o,$)||p(o,J))throw new a("The fee beneficiary must be a wallet other than the launcher or zero address.");let n=X(e.name,"name"),t=X(e.symbol,"symbol"),r=e.initialBuy===void 0?0n:L(e.initialBuy,"initialBuy",!0);if(r>U)throw new a("The initial buy exceeds uint128.");if(r===0n&&e.minAmountOut!==void 0)throw new a("A minimum output requires an initial buy.");let d=await c.readContract({address:J,abi:m,functionName:"getGraffiti",args:[s]}),i=S(await c.readContract({address:h.uerc20Factory.address,abi:m,functionName:"getUERC20Address",args:[n,t,18,J,d]})),f=await c.getCode({address:i});if(f&&f!=="0x")throw new a("This wallet already launched that name and symbol.");let w=D(q("(string,string,string,bytes)"),[[X(e.description,"description",!0),X(e.website,"website",!0),X(e.imageUri,"image URI",!0),"0x"]]),u=e.creatorFees?j[0]:j[1],b=[N({abi:m,functionName:"createToken",args:[h.uerc20Factory.address,n,t,18,ne,J,w]}),N({abi:m,functionName:"distributeToken",args:[i,{strategy:u,amount:ne,configData:D(q("address"),[o])},Ne]})],v=await Y(),G=k=>{let B=[...b];if(r>0n){let H=D(q("(address,address,bytes)"),[[de,s,M(i,!0,r,k,s,v).encoded]]);B.push(N({abi:m,functionName:"distributeWithNative",args:[h.universalRouterStrategyApp.address,H,Ne,r]}))}return y(J,N({abi:m,functionName:"multicall",args:[B]}),r,`Atomic Instant Launch: creator fees ${e.creatorFees?"on":"off"} (permanent); beneficiary ${o}.`)},E=r>0n?pe(await Z([G(U)],s),e):0n;return T([G(E)],s,`Launch ${n} (${i}, chain 4663), supply 1000000000, decimals 18. Creator fees ${e.creatorFees?"on":"off"} are permanent; fee beneficiary ${o}. Creator ETH fees come from buys only (recorded 0.09996%); sells compound into locked liquidity. Initial-buy minimum ${E} token base units. Off-chain image/display unproven; no private metadata registration. No transaction sent.`)}async function Be(e,s,o){let n=L(e.amountIn,"amountIn");if(n>U)throw new a("The trade amount exceeds uint128.");let t=S(e.token);await P(e);let r=await Y(),d=[];o||(await c.readContract({address:t,abi:Q,functionName:"allowance",args:[s,h.permit2.address]})<n&&d.push(l.approval(t,h.permit2.address,n.toString(),x)),d.push(y(h.permit2.address,N({abi:m,functionName:"approve",args:[t,de,n,Number(r)]}),0n,`Permit the exact ${n} token base units until ${r}.`)));let i=u=>[...d,y(de,N({abi:m,functionName:"execute",args:["0x10",M(t,o,n,u,s,r).inputs,r]}),o?n:0n,`${o?"Buy":"Sell"} ${t} with minimum output ${u}.`)],f=await Z(i(U),s),w=pe(f,e);return T(i(w),s,`${o?"Buy":"Sell"} token ${t} (chain 4663, 18 decimals), amountIn ${n}, minimum output ${w} ${o?"token":"ETH"} base units (18 decimals). Recorded swap fee 0.2899%; creator ETH fees from buys only, none from sells. No transaction sent.`)}async function me(e,s,o){let n=await P(e),t=BigInt(n.positionId),r=n.creatorFees?h.feeSplitterFeesOn.address:h.feeSplitterFeesOff.address,d=await c.readContract({address:h.v4PositionManager.address,abi:m,functionName:"ownerOf",args:[t]});if(!p(d,r))throw new a("The position is not locked in its current-strategy splitter.");if(!o)return T([y(r,N({abi:m,functionName:"collectFees",args:[[t]]}),0n,`Collect fees for position ${t}; permissionless.`)],s,"Collect fees for the entitled recipients; collection does not transfer creator fees to the collector. No transaction sent.");if(!n.creatorFees)throw new a("Creator fees are permanently disabled for this position.");let i=await c.readContract({address:C,abi:m,functionName:"ownerOf",args:[t]});if(!p(i,s))throw new a("Only the current fee NFT holder is entitled to claim.");let f=await c.readContract({address:C,abi:m,functionName:"amounts",args:[t]}),w=pe(f[0],e,"minEth");if(f[1]!==0n)throw new a("The current buy-only creator fee configuration returned unexpected token fees.");return T([y(C,N({abi:m,functionName:"claim",args:[t,w,0n]}),0n,`Claim collected ETH fees for position ${t} to ${s}.`)],s,`Claim collected fees: ${f[0]} ETH base units (18 decimals), minimum ${w}. Uncollected fees require poolstrade_collect first. No transaction sent.`)}async function $e(e,s){let o=await P(e),n=S(e.to);if(p(n,$))throw new a("The token recipient cannot be the zero address.");let t=L(e.amount,"amount"),r=await te(o.token,await c.getBlockNumber());return T([y(r.address,N({abi:Q,functionName:"transfer",args:[n,t]}),0n,`Transfer exactly ${t} ${re(r.symbol)} base units to ${n}.`)],s,`Transfer ${t} token base units (token ${r.address}, decimals ${r.decimals}, chain ${r.chainId}) to ${n}. No approval; no transaction sent.`)}async function Fe(e,s){if(!Array.isArray(e.positionIds)||e.positionIds.length<1||e.positionIds.length>20||!Array.isArray(e.launchTxs)||e.launchTxs.length!==e.positionIds.length)throw new a("Provide 1 to 20 positionIds and one matching launchTxs entry for each.");let o=e.positionIds.map(d=>L(d,"positionId").toString());if(new Set(o).size!==o.length)throw new a("Each position ID must appear once.");let n=e.launchTxs.map(fe),t=new Map;for(let[d,i]of o.entries()){let w=(await P({positionId:i,launchTx:n[d]})).creatorFees?h.feeSplitterFeesOn.address:h.feeSplitterFeesOff.address,u=BigInt(i),b=await c.readContract({address:h.v4PositionManager.address,abi:m,functionName:"ownerOf",args:[u]});if(!p(b,w))throw new a("The position is not locked in its current-strategy splitter.");t.set(w,[...t.get(w)??[],u])}let r=[...t].map(([d,i])=>y(d,N({abi:m,functionName:"collectFees",args:[i]}),0n,`Collect fees for positions ${i.join(", ")}; permissionless.`));return T(r,s,"Collect fees in batches for the fixed entitled recipients. Collection does not pay the collector. No transaction sent.")}let K="Current native ETH Instant Launch strategies only. Crowd Launch and older deployments are not covered.";async function te(e,s){let[o,n]=await Promise.all([c.readContract({address:e,abi:Q,functionName:"symbol",blockNumber:s}),c.readContract({address:e,abi:Q,functionName:"decimals",blockNumber:s})]);if(typeof o!="string"||!o||o.length>256||n!==18)throw new a("The current launch token returned invalid metadata.");return{address:e,symbol:o,decimals:n,chainId:x}}async function he(e,s,o,n){let t=n??await te(e.token,o),r=await c.readContract({address:t.address,abi:Q,functionName:"balanceOf",args:[s],blockNumber:o});return{token:t,amount:r.toString(),humanAmount:l.formatAmount(r.toString(),t.decimals)}}async function Pe(e,s){let o=await P(e),n=await c.getBlockNumber();return{wallet:s,...await he(o,s,n),blockNumber:n.toString(),coverage:K}}async function Le(e,s){let o=fe(e.launchTx),n=await c.getTransactionReceipt({hash:o}),t=se(n);if(e.token!==void 0&&(t=t.filter(i=>p(i.token,S(e.token)))),e.positionId!==void 0&&(t=t.filter(i=>i.positionId===L(e.positionId,"positionId").toString())),!t.length)throw new a("The receipt contains no matching current Instant Launch. Crowd Launch and older strategies are not covered.");let r=await c.getBlockNumber(),d=await Promise.all(t.map(async i=>{let f=i.creatorFees?h.feeSplitterFeesOn.address:h.feeSplitterFeesOff.address,w=await c.readContract({address:h.v4PositionManager.address,abi:m,functionName:"ownerOf",args:[BigInt(i.positionId)],blockNumber:r});if(!p(w,f))throw new a("The position is not locked in its current-strategy splitter.");let u=i.creatorFees?{owner:await c.readContract({address:C,abi:m,functionName:"ownerOf",args:[BigInt(i.positionId)],blockNumber:r}),approved:await c.readContract({address:C,abi:m,functionName:"getApproved",args:[BigInt(i.positionId)],blockNumber:r}),collected:await c.readContract({address:C,abi:m,functionName:"amounts",args:[BigInt(i.positionId)],blockNumber:r})}:void 0,b=await te(i.token,r);return{...i,token:b,custodian:w,holding:await he(i,s,r,b),...u?{feeEntitlement:{owner:u.owner,approved:u.approved,collected:[{token:le,amount:u.collected[0].toString()},{token:b,amount:u.collected[1].toString()}],uncollectedFeesIncluded:!1}}:{}}}));return{launchTx:o,wallet:s,creator:n.from,blockNumber:r.toString(),launches:d,coverage:K}}async function Oe(e){let s=await c.getBlockNumber(),o=e.limit??20;if(typeof o!="number"||!Number.isInteger(o)||o<1||o>50)throw new a("limit must be an integer from 1 to 50.");let n=e.fromBlock===void 0?s>=R+ue?s-ue+1n:R:L(e.fromBlock,"fromBlock",!0),t=e.toBlock===void 0?s:L(e.toBlock,"toBlock",!0),r=0;if(e.cursor!==void 0){if(typeof e.cursor!="string"||!/^[0-9]{1,78}:[0-9]{1,78}:[0-9]{1,10}$/.test(e.cursor))throw new a("Provide the browse cursor exactly as returned.");let u=e.cursor.split(":"),b=BigInt(u[0]),v=BigInt(u[1]);if(e.fromBlock!==void 0&&n!==b||e.toBlock!==void 0&&t!==v)throw new a("The cursor does not match this block range.");n=b,t=v,r=Number(u[2])}if(s<R&&e.fromBlock===void 0&&e.toBlock===void 0&&e.cursor===void 0)return{launches:[],cursor:null,fromBlock:R.toString(),toBlock:s.toString(),coverage:K,predeployment:!0};if(n<R||t<n||t>s||t-n>=ue)throw new a("Choose a deployed block range of at most 100000 blocks, ending no later than the current head.");let d=await c.getLogs({address:j,event:z[0],fromBlock:n,toBlock:t,strict:!0});if(d.some(u=>u.blockNumber===null||u.logIndex===null||!u.transactionHash))throw new a("The launch feed returned an incomplete log.");if(d.sort((u,b)=>u.blockNumber===b.blockNumber?b.logIndex-u.logIndex:u.blockNumber>b.blockNumber?-1:1),r>d.length)throw new a("The browse cursor is outside the launch feed.");let i=new Map,f=[];for(let u of d.slice(r,r+o)){let b=u.transactionHash,v=i.get(b);v||(v=await c.getTransactionReceipt({hash:b}),i.set(b,v));let G=ie({abi:z,eventName:"TokenLaunched",data:u.data,topics:u.topics}).args,E=se(v).filter(k=>p(k.token,G.token)&&p(k.poolId,G.poolId));if(E.length!==1)throw new a("The launch feed log does not match one verified receipt launch.");f.push({...E[0],launchTx:b,blockNumber:u.blockNumber.toString(),token:await te(E[0].token,t),creator:v.from})}let w=r+o;return{launches:f,cursor:w<d.length?`${n}:${t}:${w}`:null,fromBlock:n.toString(),toBlock:t.toString(),coverage:K,previousToBlock:n>R?(n-1n).toString():null,summary:"Newest launches first within this fixed block range. Empty does not establish absence outside the range or covered strategies."}}async function ge(e,s,o){let n=await P(e);if(!n.creatorFees)throw new a("Creator fees are permanently disabled for this position.");let t=BigInt(n.positionId),r=await c.readContract({address:h.v4PositionManager.address,abi:m,functionName:"ownerOf",args:[t]});if(!p(r,h.feeSplitterFeesOn.address))throw new a("The position is not locked in its current-strategy splitter.");let d=await c.readContract({address:C,abi:m,functionName:"ownerOf",args:[t]});if(!p(d,s))throw new a("Only the current fee NFT holder can change this entitlement.");let i=S(o?e.to:e.spender);if(p(i,C)||o&&p(i,$))throw new a("The fee NFT recipient cannot be the vault or zero address.");let f=o?N({abi:m,functionName:"safeTransferFrom",args:[s,i,t]}):N({abi:m,functionName:"approve",args:[i,t]});return T([y(C,f,0n,o?`Transfer fee NFT ${t} to ${i}, including accrued and future fees.`:`Approve ${i} for fee NFT ${t} only; zero address revokes approval.`)],s,o?`Transfer the entire fee entitlement for position ${t} to ${i}. This includes collected and future fees; locked LP remains in its splitter. No transaction sent.`:`Set the exact single-NFT approval for position ${t} to ${i}. This permits transfer of that fee entitlement; zero address revokes. No transaction sent.`)}async function Ee(){return{chainId:x,instant:{supported:!0,supply:ne.toString(),decimals:18,currency:le,permanentCreatorFeeChoice:!0},crowd:{status:"BLOCKED",strategy:"0xbf1aB81f7d534b2CC0Da76fcf4d541322bB0e000",factory:"0x000000001F26a0044BaA66024e7b6599c61963F8",missing:"A verified Pools-specific auction configuration (BlockNumberish timing, reserve allocation, Q96 floor/tick, USD FDV conversion, issuance steps, locked LP plan) and a bytecode-matched factory-created auction ABI with success/refund fixtures. Generic CCA parameters are not a verified Pools Crowd Launch.",source:"https://github.com/Uniswap/sdks/blob/main/sdks/liquidity-launcher-sdk/src/addresses.ts"},coverage:K}}let g={type:"string"},I=Te(),we={chainId:{type:"integer",const:x},slippageBps:{type:"integer",minimum:0,maximum:9999}};function A(e,s,o,n){return{name:`poolstrade_${e}`,inputSchema:{type:"object",additionalProperties:!1,properties:{...we,...s},required:o},execute:async(t,r)=>{try{let d=new Set([...Object.keys(we),...Object.keys(s)]);if(Object.keys(t).some(i=>!d.has(i)))throw new a("Unsupported input for this pools.trade tool.");if(t.chainId!==void 0&&t.chainId!==x)throw new a("pools.trade requires chain 4663.");if(S(r),t.slippageBps!==void 0){if(typeof t.slippageBps!="number")throw new a("Slippage must be an integer in basis points.");ce("10000",t.slippageBps)}return await V(),await n(t,r)}catch(d){O(d)}}}}return{tools:[A("launch",{name:g,symbol:g,creatorFees:{type:"boolean",description:"Permanent choice; must be explicit."},feeBeneficiary:g,pair:g,decimals:{type:"integer",const:18},supply:I,initialBuy:I,minAmountOut:I,description:g,website:g,imageUri:g},["name","symbol","creatorFees","feeBeneficiary"],Se),...["buy","sell"].map(e=>A(e,{token:g,amountIn:I,minAmountOut:I,launchTx:g},["token","amountIn"],(s,o)=>Be(s,o,e==="buy"))),A("collect",{positionId:I,launchTx:g},["positionId"],(e,s)=>me(e,s,!1)),A("claim",{positionId:I,launchTx:g,minEth:I},["positionId"],(e,s)=>me(e,s,!0)),A("browse",{fromBlock:I,toBlock:I,limit:{type:"integer",minimum:1,maximum:50},cursor:g},[],Oe),A("balance",{token:g,launchTx:g},["token"],Pe),A("status",{launchTx:g,token:g,positionId:I},["launchTx"],Le),A("launch_options",{},[],Ee),A("fee_transfer",{positionId:I,launchTx:g,to:g},["positionId","to"],(e,s)=>ge(e,s,!0)),A("fee_approve",{positionId:I,launchTx:g,spender:g},["positionId","spender"],(e,s)=>ge(e,s,!1)),A("transfer",{token:g,amount:I,to:g,launchTx:g},["token","amount","to"],$e),A("collect_many",{positionIds:{type:"array",items:I,minItems:1,maxItems:20},launchTxs:{type:"array",items:g,minItems:1,maxItems:20}},["positionIds","launchTxs"],Fe)],positions:async e=>{S(e);let s=[],o=0,n=!0,t,r=i=>({module:"poolstrade",id:"poolstrade-discovery-incomplete",chainId:x,assets:[],incomplete:!0,description:`${i} Checked ${o} launch receipts. Readable holdings are retained. Check a known launch with poolstrade_status {"launchTx":"<hash>"} or its token holding with poolstrade_balance {"token":"<address>","launchTx":"<hash>"}. Crowd Launch and older deployments are outside this reader's coverage.`}),d=async()=>{await V(),n&&await F(e,void 0,async i=>{o++;for(let f of se(i)){if(!n)return;let w=f.creatorFees&&p(await c.readContract({address:C,abi:m,functionName:"ownerOf",args:[BigInt(f.positionId)]}),e);if(!n)return;if(!w&&!p(i.from,e))continue;let u=w?[{token:le,amount:(await c.readContract({address:C,abi:m,functionName:"amounts",args:[BigInt(f.positionId)]}))[0].toString()}]:[];n&&s.push({module:"poolstrade",id:f.positionId,chainId:x,assets:u,description:`Current Instant Launch ${f.token} (18 decimals, supply 1000000000), pool ${f.poolId}; creator fees ${f.creatorFees?"on":"off"} (permanent). ${w?"Collected ETH fees only; uncollected fees excluded.":"Launch record; no fee entitlement held."} Liquidity is permanently locked.`})}},()=>n)};try{return await Promise.race([d().then(()=>!0),new Promise(f=>{t=setTimeout(()=>{n=!1,f(!1)},6e3)})])?s:[...s,r("Pools.trade global launch discovery reached its 6000 ms read budget; the historical scan is incomplete.")]}catch(i){return[...s,r(`Pools.trade discovery could not finish: ${l.plainError(i)}`)]}finally{n=!1,t!==void 0&&clearTimeout(t)}}}};function Qe(l){return xe("poolstrade",[Me(l)])}export{se as a,Me as b,Qe as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as h}from"./
|
|
1
|
+
import{e as h}from"./NWNYJ26T.js";import{a as e}from"./XSD5NL7J.js";import{getAddress as y,isAddress as m,keccak256 as E,toBytes as _}from"viem";var l={source:"https://heyresearch.xyz/openapi.json",retrievedAt:"2026-11-02T21:21:26Z",sha256:"789fdd4f67e290e4c75f6c5992041a465b57dd55fa8d4ac5d4136a7145095ffa",note:"Excerpt of two operations only. No other operation is described here; the 55-operation catalogue.json keeps its own older pin.",operations:[{operation:"getProofOfShipShips",path:"/api/v1/proof-of-ship/ships",summary:"The ships HEY counts for a project in a closed window, unsigned",parameters:[{name:"slug",in:"query",required:!0,schema:{type:"string",pattern:"^[a-z0-9][a-z0-9-]{0,79}$",maxLength:80,minLength:1}},{name:"since",in:"query",required:!0,schema:{type:"integer",minimum:0}},{name:"until",in:"query",required:!0,schema:{type:"integer",minimum:0}}],format:"json",response:{type:"object",required:["slug","currentSlug","since","until","ships","evidenceIds","evidenceUrls","evidenceHash","definition"],properties:{slug:{type:"string"},currentSlug:{type:"string"},since:{type:"integer"},until:{type:"integer"},ships:{type:"integer",minimum:0},evidenceIds:{type:"array",items:{type:"string"}},evidenceUrls:{type:"array",items:{type:"string"}},evidenceHash:{type:"string",pattern:"^0x[0-9a-f]{64}$"},definition:{type:"string"}}}},{operation:"getProofOfShipTie",path:"/api/v1/proof-of-ship/tie",summary:"The payout addresses HEY would sign a Proof of Ship attestation for",parameters:[{name:"slug",in:"query",required:!0,schema:{type:"string",pattern:"^[a-z0-9][a-z0-9-]{0,79}$",maxLength:80,minLength:1}}],format:"json",response:{type:"object",required:["slug","currentSlug","payable","ties"],properties:{slug:{type:"string",description:"The slug as asked."},currentSlug:{type:"string",description:"The page's current slug."},payable:{type:"boolean",description:"Whether `ties` holds an address the attestation would accept as `builder`."},ties:{type:"array",items:{type:"object",required:["kind","address"],properties:{kind:{type:"string",enum:["wallet_claim","token_deployer"]},address:{type:"string",pattern:"^0x[0-9a-fA-F]{40}$",description:"Checksummed."}}}},reason:{type:"string",enum:["no_token","token_not_verified","issuer_token","site_disclaims_contract","site_names_another_contract","contested","no_tie"],description:"Present only when `ties` is empty."},attestationsPaused:{type:"boolean",enum:[!0],description:"Present only while the operator has paused attestations."}}}}]};var B="Builder evidence, not a trading signal. HEY Research Lab tracks builder activity only. It is not an endorsement, audit or rating.",v=["getProofOfShipShips","getProofOfShipTie"],g=/^[a-z0-9][a-z0-9-]{0,79}$/,S=/^ship:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,P=/^0x[0-9a-f]{64}$/,H=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u,k="https://heyresearch.xyz/evidence/",O=400*86400,Y=["wallet_claim","token_deployer"],x=["no_token","token_not_verified","issuer_token","site_disclaims_contract","site_names_another_contract","contested","no_tie"],I=["chain","chainId","chain_id"];function A(r){return v.includes(r)}function f(r){return typeof r=="number"&&Number.isSafeInteger(r)&&r>=0}function T(r,t,n=Math.floor(Date.now()/1e3)){if(!A(r))throw new e("Choose getProofOfShipShips or getProofOfShipTie.");if(!h(t))throw new e("Provide the documented parameters as an object.");let o=l.operations.find(i=>i.operation===r);for(let i of Object.keys(t)){if(I.includes(i))throw new e("Proof of ship reads cover Robinhood Chain mainnet (4663) only and take no chain parameter.");if(!o.parameters.some(d=>d.name===i))throw new e(`Unsupported parameter ${i} for ${r}.`)}for(let i of o.parameters)if(i.required&&t[i.name]===void 0)throw new e(`Provide ${i.name} for ${r}.`);if(typeof t.slug!="string"||!g.test(t.slug))throw new e("Provide the project slug exactly as HEY publishes it: lower-case letters, digits and hyphens, at most 80 characters.");if(r==="getProofOfShipTie")return;let{since:a,until:s}=t;if(!f(a)||!f(s))throw new e("Provide since and until as whole unix seconds.");if(s>n)throw new e("The window must have ended: until cannot be in the future.");if(a>s)throw new e("The window must start before it ends.");if(s-a>O)throw new e("The window can be at most 400 days long.")}function p(r,t){let n=r[t];if(typeof n!="string"||!g.test(n))throw new e(`HEY returned an unexpected ${t}. Please try again.`);return n}function q(r,t){if(p(t,"slug")!==r.slug)throw new e("HEY returned a different project than the one requested.");if(p(t,"currentSlug"),t.since!==r.since||t.until!==r.until)throw new e("HEY returned a different window than the one requested.");let{ships:n,evidenceIds:o,evidenceUrls:a,evidenceHash:s,definition:i}=t;if(!f(n)||!Array.isArray(o)||!Array.isArray(a))throw new e("HEY returned an unexpected ships count. Please try again.");if(!o.every(u=>typeof u=="string"&&S.test(u)))throw new e("HEY returned an evidence id that is not a ship receipt.");let d=o;if(!d.every((u,c)=>c===0||d[c-1]<u))throw new e("HEY returned evidence ids that are not sorted and unique.");if(n!==d.length)throw new e("HEY returned a ships count that does not match its evidence ids.");if(a.length!==d.length||!d.every((u,c)=>a[c]===`${k}${u}`))throw new e("HEY returned an evidence link that is not the published HEY receipt link.");if(typeof s!="string"||!P.test(s)||E(_(d.join(",")))!==s)throw new e("HEY returned an evidence hash that does not match its evidence ids.");if(typeof i!="string"||!i||H.test(i))throw new e("HEY returned an unexpected counting definition. Please try again.")}function R(r,t){if(p(t,"slug")!==r.slug)throw new e("HEY returned a different project than the one requested.");p(t,"currentSlug");let{payable:n,ties:o,reason:a,attestationsPaused:s}=t;if(typeof n!="boolean"||!Array.isArray(o))throw new e("HEY returned an unexpected tie answer. Please try again.");for(let i of o)if(!h(i)||!Y.includes(i.kind)||typeof i.address!="string"||!m(i.address,{strict:!1})||y(i.address)!==i.address)throw new e("HEY returned a tie that is not a known kind with a checksummed address.");if(n!==o.length>0)throw new e("HEY returned a payable flag that does not match its ties.");if(o.length?a!==void 0:!x.includes(a))throw new e("HEY returned an unexpected reason for the tie answer.");if(s!==void 0&&s!==!0)throw new e("HEY returned an unexpected attestation pause flag.")}function D(r,t,n,o=Math.floor(Date.now()/1e3)){if(T(r,t,o),!h(n)||!Object.keys(n).length||n.error!==void 0)throw new e("HEY returned an unexpected response. Please try again.");if(n.chainId!==void 0&&n.chainId!==4663||n.chain_id!==void 0&&n.chain_id!==4663)throw new e("HEY returned another chain.");if(n.nextCursor!=null||n.nextOffset!=null)throw new e("HEY signalled a continuation that this read does not support, so the answer may be incomplete.");r==="getProofOfShipShips"?q(t,n):R(t,n)}export{l as a,B as b,v as c,T as d,D as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as G}from"./
|
|
1
|
+
import{b as G}from"./VYAJXLND.js";import{a as p}from"./43LI5NKJ.js";import{a as W}from"./66F5ZH34.js";import{g as P}from"./NWNYJ26T.js";import{b as T}from"./IX3GZMTM.js";import{a as w,d as R,i as B}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{encodeFunctionData as h,getAddress as L,parseAbi as x}from"viem";var y={address:L("0x451b42a15100c340ca12f7c66de06fac5ea2d751"),symbol:"BOW",decimals:18,chainId:w},u=L("0xeba502e1177f5fad9432c2deb273569d8381e01a"),b={address:B[w].tokens.USDG.address,symbol:"USDG",decimals:R,chainId:w},i=x(["function stakingToken() view returns (address)","function rewardsToken() view returns (address)","function balanceOf(address account) view returns (uint256)","function earned(address account) view returns (uint256)","function stake(uint256 amount)","function withdraw(uint256 amount)","function getReward()","function exit()","function cooldown() view returns (uint256)","function stakedAt(address) view returns (uint256)","function stakePaused() view returns (bool)","function totalSupply() view returns (uint256)","function rewardRate() view returns (uint256)","function rewardsDuration() view returns (uint256)","function periodFinish() view returns (uint256)","function owner() view returns (address)","function rewardsDistribution() view returns (address)","function notifyRewardAmount(uint256 reward)","function setRewardsDistribution(address distribution)","function setRewardsDuration(uint256 duration)","function setCooldown(uint256 cooldown)","function setStakePaused(bool paused)","function recoverERC20(address token,uint256 amount)","function transferOwnership(address newOwner)","function renounceOwnership()"]),X=m=>{async function D(n){try{return await n()}catch(t){throw new o(m.plainError(t))}}function A(n,t){if(Object.keys(n).some(e=>!t.includes(e)))throw new o("Unsupported Longbow staking input. Use the fields in the tool schema.")}async function U(){let n=m.clientFor(w);if(await n.getChainId()!==w)throw new o("Longbow requires a client on chain 4663.");let[t,e]=await Promise.all([n.readContract({address:u,abi:i,functionName:"stakingToken"}),n.readContract({address:u,abi:i,functionName:"rewardsToken"})]);if(typeof t!="string"||typeof e!="string"||!P(t,y.address)||!P(e,b.address))throw new o("Longbow staking does not report the pinned BOW stake and USDG reward tokens.");return n}async function S(n){let t=await U(),[e,a,s]=await Promise.all([t.readContract({address:u,abi:i,functionName:"balanceOf",args:[n]}),t.readContract({address:u,abi:i,functionName:"earned",args:[n]}),t.readContract({address:y.address,abi:i,functionName:"balanceOf",args:[n]})]);return{staked:e,earned:a,held:s,rpc:t}}async function v(n,t,e){let a=await m.preview(n,t),s=a.changes.map(({token:r,amount:d})=>{let c=d.startsWith("-");return`${c?"-":"+"}${m.formatAmount(c?d.slice(1):d,r.decimals)} ${r.symbol}`}).join(", ");return{txs:n,preview:a,summary:`${e} ${a.summary} ${s?`Estimated changes: ${s}. `:""}No transaction was sent.`}}let O=(n,t)=>m.unsignedTx({to:u,data:n,value:"0",chainId:w,description:t}),l=n=>m.formatAmount(n.toString(),y.decimals);async function _(n,t){if(A(n,["amount"]),p(t),typeof n.amount!="string")throw new o("Provide an integer BOW amount in base units (18 decimals).");let e=T(n.amount),{held:a,rpc:s}=await S(t),[r,d]=await Promise.all([s.readContract({address:u,abi:i,functionName:"cooldown"}),s.readContract({address:u,abi:i,functionName:"stakePaused"})]);if(d)throw new o("Longbow new stakes are paused; withdrawals and claims remain available.");if(e<=0n)throw new o("Stake amount must be positive.");if(e>a)throw new o(`Insufficient BOW: wallet holds ${a.toString()} base units, requested ${e.toString()}.`);return v([m.approval(y.address,u,e.toString(),w),O(h({abi:i,functionName:"stake",args:[e]}),`Stake ${l(e)} BOW in Longbow StakingRewards.`)],t,`Approve exactly ${l(e)} BOW, then stake it for USDG rewards. Current withdrawal cooldown: ${r} seconds; staking restarts that clock.`)}async function I(n,t){A(n,["amount"]),p(t);let{staked:e,earned:a,rpc:s}=await S(t),r=await s.readContract({address:u,abi:i,functionName:"cooldown"});if(r>0n){let[c,g]=await Promise.all([s.readContract({address:u,abi:i,functionName:"stakedAt",args:[t]}),s.getBlock()]);if(g.timestamp<c+r)throw new o(`Longbow unstaking cooldown ends at Unix second ${c+r}. Rewards can still be claimed.`)}if(e===0n)throw new o("This wallet has no BOW staked with Longbow.");if(n.amount==="all")return v([O(h({abi:i,functionName:"exit"}),`Unstake all ${l(e)} BOW and claim USDG rewards.`)],t,`Exit Longbow staking: return all ${l(e)} staked BOW and claim ${m.formatAmount(a.toString(),b.decimals)} USDG of earned rewards in one call.`);if(typeof n.amount!="string")throw new o('Provide an integer BOW amount in base units, or "all".');let d=T(n.amount);if(d<=0n||d>e)throw new o(`Unstake amount must be positive and at most the ${e.toString()} base units staked.`);return v([O(h({abi:i,functionName:"withdraw",args:[d]}),`Unstake ${l(d)} BOW.`)],t,`Unstake ${l(d)} BOW. Earned USDG rewards stay claimable with longbow_claim_rewards.`)}async function E(n,t){A(n,[]),p(t);let{earned:e}=await S(t);if(e===0n)throw new o("No Longbow staking rewards to claim for this wallet.");let a=m.formatAmount(e.toString(),b.decimals);return v([O(h({abi:i,functionName:"getReward"}),`Claim ${a} USDG of Longbow staking rewards.`)],t,`Claim ${a} USDG of earned Longbow staking rewards; staked BOW stays staked.`)}async function F(n){return D(async()=>{p(n);let{staked:t,earned:e}=await S(n);return t===0n&&e===0n?[]:[{module:"longbow",id:`${w}:${u.toLowerCase()}`,chainId:w,assets:[...t>0n?[{token:{...y},amount:t.toString()}]:[],...e>0n?[{token:{...b},amount:e.toString()}]:[]],description:`Longbow BOW staking: ${l(t)} BOW staked, ${m.formatAmount(e.toString(),b.decimals)} USDG rewards earned and claimable.`}]})}let $=(n,t,e,a)=>({name:n,inputSchema:{type:"object",properties:t,required:e,additionalProperties:!1},execute:(s,r)=>D(()=>a(s,r))});async function j(n,t){A(n,[]),p(t);let{staked:e,earned:a,held:s,rpc:r}=await S(t),d=["cooldown","stakePaused","totalSupply","rewardRate","rewardsDuration","periodFinish","owner","rewardsDistribution"],c=await Promise.all(d.map(f=>r.readContract({address:u,abi:i,functionName:f}))),g=await r.readContract({address:u,abi:i,functionName:"stakedAt",args:[t]});return{chainId:w,staking:u,stakeToken:y,rewardToken:b,staked:e.toString(),earned:a.toString(),walletBalance:s.toString(),stakedAt:g.toString(),...Object.fromEntries(d.map((f,k)=>[f,typeof c[k]=="bigint"?c[k].toString():c[k]])),rewardRateScale:"1000000000000000000",caveat:"rewardRate is USDG base units multiplied by 1e18 per second, not APY. Cooldown and pause state are owner-configurable."}}let C=[["notifyRewardAmount",["uint256"]],["setRewardsDistribution",["address"]],["setRewardsDuration",["uint256"]],["setCooldown",["uint256"]],["setStakePaused",["bool"]],["recoverERC20",["address","uint256"]],["transferOwnership",["address"]],["renounceOwnership",[]]];async function q(n,t){A(n,["operation","values","fund"]),p(t);let e=C.find(([f])=>f===n.operation);if(!e||!Array.isArray(n.values)||n.values.length!==e[1].length)throw new o("Choose a staking operation and its exact ordered values.");let a=e[1].map((f,k)=>G(f,n.values[k])),s=await U(),r=e[0]==="notifyRewardAmount",d=await s.readContract({address:u,abi:i,functionName:r?"rewardsDistribution":"owner"});if(!P(d,t))throw new o("This wallet lacks the Longbow staking owner/distribution role.");if(n.fund!==void 0&&(typeof n.fund!="boolean"||!r))throw new o("fund is a boolean available only for notifyRewardAmount.");let c=`Longbow staking ${e[0]}, values ${JSON.stringify(n.values)}.${e[0]==="renounceOwnership"?" Owner administration is permanently relinquished.":""}`,g=[];if(r&&n.fund===!0){let f=a[0];if(f===0n)throw new o("Reward funding must be positive.");let k=x(["function transfer(address,uint256) returns (bool)"]);g.push(m.unsignedTx({to:b.address,data:h({abi:k,functionName:"transfer",args:[u,f]}),value:"0",chainId:w,description:`Fund exactly ${f} USDG base units before notifying rewards.`}))}return g.push(O(h({abi:i,functionName:e[0],args:a}),c)),v(g,t,`${c} ${n.fund===!0?"Funding and notification are separate transactions. A failed notification leaves funded USDG in the staking contract.":""}`)}let N=W("Positive BOW amount in integer base units (18 decimals).");return{positions:F,tools:[$("longbow_staking_status",{},[],j),$("longbow_manage_staking",{operation:{enum:C.map(([n])=>n)},values:{type:"array",maxItems:2,items:{oneOf:[{type:"string"},{type:"boolean"}]}},fund:{type:"boolean"}},["operation","values"],q),$("longbow_stake",{amount:N},["amount"],_),$("longbow_unstake",{amount:{anyOf:[N,{const:"all",description:"Unstake everything and claim rewards in one exit() call."}]}},["amount"],I),$("longbow_claim_rewards",{},[],E)]}};export{y as a,u as b,X as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as B}from"./
|
|
1
|
+
import{c as B}from"./VEQBHI6O.js";import{b as x,e as d,g as k}from"./NWNYJ26T.js";import{a as l}from"./XSD5NL7J.js";import{getAddress as C,keccak256 as I,toHex as D}from"viem";var R="https://balancesapi.ponsfamily.com/v1",P=/^(0|[1-9][0-9]{0,77})$/,$=/^[0-9A-Za-z_.-]{1,128}$/,y=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>=0,p=e=>typeof e=="string"&&P.test(e),S=e=>typeof e=="string"&&x.test(e);function M(e){return d(e)&&S(e.token)&&y(e.holders)&&p(e.supply)&&p(e.burned)&&p(e.circulating)&&d(e.as_of)&&y(e.as_of.rollup_bucket)&&y(e.as_of.tail_from_block)&&(e.next_cursor===null||e.next_cursor===void 0||typeof e.next_cursor=="string"&&$.test(e.next_cursor))&&Array.isArray(e.page)&&e.page.length<=50&&e.page.every(t=>d(t)&&S(t.wallet)&&p(t.balance)&&(t.label===void 0||t.label===null||typeof t.label=="string"))}var A=new WeakMap,c=()=>new l("The Pons holder index changed or returned an incomplete directory. Retry pons_holders without a cursor.");async function T(e,t){let n=A.get(e);n||(n=new Map,A.set(e,n));let f=n.get(t);if(f&&f.expires>Date.now())return f.directory;let o,g,m=new Set,_=new Set,s=[];for(let b=0;b<2e3;b++){let h=new URL(`${R}/tokens/${t.toLowerCase()}/holders`);h.searchParams.set("limit","50"),g&&h.searchParams.set("cursor",g);let r=await B(e.http,h.toString(),{method:"GET",redirect:"error",headers:{accept:"application/json"}},M);if(!k(r.token,t))throw c();if(r.holders>1e5)throw new l("The Pons holder directory exceeds 100000 indexed holders. No total or rank was computed.");if(o??=r,r.holders!==o.holders||r.supply!==o.supply||r.burned!==o.burned||r.circulating!==o.circulating||r.as_of.rollup_bucket!==o.as_of.rollup_bucket||r.as_of.tail_from_block!==o.as_of.tail_from_block)throw c();for(let u of r.page){let i=C(u.wallet);if(_.has(i)||BigInt(u.balance)===0n)throw c();_.add(i),s.push({...u,wallet:i})}if(s.length>o.holders)throw c();if(!r.next_cursor){if(s.length!==o.holders)throw c();s.sort((a,w)=>BigInt(a.balance)>BigInt(w.balance)?-1:BigInt(a.balance)<BigInt(w.balance)?1:a.wallet.toLowerCase().localeCompare(w.wallet.toLowerCase()));let u=I(D(JSON.stringify([t,o.as_of,s.map(a=>[a.wallet,a.balance])]))).slice(2,18),i={body:o,rows:s,fingerprint:u,fetchedAt:new Date().toISOString()};return n.delete(t),n.size>=4&&n.delete(n.keys().next().value),n.set(t,{directory:i,expires:Date.now()+15e3}),i}if(!r.page.length||m.has(r.next_cursor))throw c();m.add(r.next_cursor),g=r.next_cursor}throw new l("The Pons holder directory exceeds 100000 indexed holders. No total or rank was computed.")}function U(e){if(e===void 0)return{offset:0};if(typeof e!="string")throw new l("Use the nextCursor returned by the previous pons_holders page.");let t=/^holders_([0-9]{1,6})_([0-9a-f]{16})$/.exec(e);if(!t)throw new l("Use the nextCursor returned by the previous pons_holders page.");return{offset:Number(t[1]),fingerprint:t[2]}}function z(e,t){if(BigInt(t)===0n)return null;let n=BigInt(e)*10n**18n/BigInt(t);return`${n/10n**18n}.${(n%10n**18n).toString().padStart(18,"0")}`}export{R as a,T as b,U as c,z as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as P,e as E,f,h as M,j as b,k as V,l as T,m as q,n as j,o as g,p as S,q as x,t as F,w as U,z as $}from"./
|
|
1
|
+
import{d as P,e as E,f,h as M,j as b,k as V,l as T,m as q,n as j,o as g,p as S,q as x,t as F,w as U,z as $}from"./N4Q6GN65.js";import{c as m}from"./X5V2Z2NM.js";import{a as _}from"./43LI5NKJ.js";import{c as R,g as v}from"./NWNYJ26T.js";import{a as i}from"./XSD5NL7J.js";import{a as I}from"./JXOEJPJ4.js";import{encodeFunctionData as N,keccak256 as G,toBytes as L}from"viem";var D=`0x${"00".repeat(32)}`,ae=d=>{let A=(e,t,s)=>({name:e,inputSchema:t,execute:async(r,a)=>{try{return _(a),j(d,r.chainId),await s(r,a)}catch(u){throw new i(d.plainError(u))}}}),C={transactionHash:{...E,description:"After local submission, repeat the same arguments with the mined hash to verify calldata, event and registry state."}},w=(e,t,s)=>d.clientFor(M(d).chainId).readContract({address:e,abi:m,functionName:t,args:s}),p=async(e,t)=>{try{return await w(e,"getValidationStatus",[t])}catch{return}},H=(e,t)=>({requestHash:e,validator:t[0],agentId:t[1].toString(),response:t[2],responseHash:t[3],tag:I(t[4]),lastUpdate:t[5].toString(),possiblyUnanswered:t[2]===0&&t[3]===D&&t[4]===""}),W=A("erc8004_validation_request",{type:"object",additionalProperties:!1,required:["agentId","validator","requestURI"],description:"Ask a validator (re-execution staker, zkML verifier, TEE oracle, judge) to check an agent's work (Validation Registry validationRequest). Owner or approved operator only.",properties:{agentId:P,validator:{...R,description:"The validator contract or wallet that will respond."},requestURI:{type:"string",description:"HTTPS/IPFS URI of the data the validator needs (inputs and outputs)."},requestHash:{...f,description:"keccak256 commitment to the request payload; provide this or requestContent."},requestContent:{type:"string",description:"The exact request payload text; Oak commits its keccak256 as requestHash."},...C}},async(e,t)=>{let{address:s}=b(d),r=T(e.agentId),a=q(e.validator,"validator");if(V(a))throw new i("Provide a real validator address.");let u=x(e.requestURI,"requestURI");if(e.requestHash===void 0==(e.requestContent===void 0))throw new i("Provide exactly one of requestHash or requestContent.");let l=e.requestHash!==void 0?g(e.requestHash,"requestHash"):G(L(S(e.requestContent,"requestContent",1e6,!1)));return $(d,t,e,{to:s,data:N({abi:m,functionName:"validationRequest",args:[a,r,u,l]}),description:`Request validation of ERC-8004 agent ${r} by ${a}.`,summary:`Asks ${a} to validate agent ${r}'s work: request ${l}, data at ${I(u)}. The request is public and permanent. Only the named validator can respond. Repeat with transactionHash to verify.`,authority:async()=>{if(await F(d,r,t,"request validation"),await p(s,l))throw new i("A validation request with that requestHash already exists; use a different payload commitment.")},verify:async h=>{let c=U(h,s,m,"ValidationRequest"),o=await p(s,l);if(!o||!v(String(c.validatorAddress),a)||c.agentId!==r||c.requestHash!==l||o[1]!==r||!v(o[0],a))throw new i("The registry event or stored request does not match.");return{...H(l,o),confirmed:!0}}})}),Z=A("erc8004_validation_response",{type:"object",additionalProperties:!1,required:["requestHash","response"],description:"As the named validator, record a validation result from 0 (failed) to 100 (passed) for a request. May be called again to update.",properties:{requestHash:f,response:{type:"integer",minimum:0,maximum:100},responseURI:{type:"string",description:"Optional HTTPS/IPFS evidence or audit URI."},responseHash:{...f,description:"Optional commitment to the evidence content."},tag:{type:"string",description:"Optional category, e.g. soft-finality / hard-finality."},...C}},async(e,t)=>{let{address:s}=b(d),r=g(e.requestHash,"requestHash"),a=e.response;if(typeof a!="number"||!Number.isInteger(a)||a<0||a>100)throw new i("response must be an integer from 0 to 100.");let u=e.responseURI===void 0?"":x(e.responseURI,"responseURI"),l=e.responseHash===void 0?D:g(e.responseHash,"responseHash"),h=S(e.tag,"tag",128);return $(d,t,e,{to:s,data:N({abi:m,functionName:"validationResponse",args:[r,a,u,l,h]}),description:`Respond ${a}/100 to validation request ${r}.`,summary:`Records validation result ${a}/100${h?` (tag ${I(h)})`:""} for request ${r} as this wallet. It is public; a later response replaces the stored result but the event history stays. Repeat with transactionHash to verify.`,authority:async()=>{let c=await p(s,r);if(!c)throw new i("No validation request has that requestHash.");if(!v(c[0],t))throw new i("Only the validator named in the request can respond to it.")},verify:async c=>{let o=U(c,s,m,"ValidationResponse"),n=await p(s,r);if(!n||o.requestHash!==r||o.response!==a||!v(String(o.validatorAddress),t)||n[2]!==a)throw new i("The registry event or stored result does not match.");return{...H(r,n),confirmed:!0}}})}),z=A("erc8004_validation",{type:"object",additionalProperties:!1,description:"Read-only validation lookups. Provide exactly one of requestHash (one request), agentId (its requests and average) or validator (requests addressed to it).",properties:{requestHash:f,agentId:P,validator:R,validators:{type:"array",maxItems:50,items:R,description:"With agentId: average only these validators."},tag:{type:"string",description:"With agentId: average only this tag."},limit:{type:"integer",minimum:1,maximum:100,default:25}}},async e=>{let{address:t}=b(d),s=["requestHash","agentId","validator"].filter(n=>e[n]!==void 0);if(s.length!==1)throw new i("Provide exactly one of requestHash, agentId or validator.");let r=typeof e.limit=="number"?Math.min(Math.max(1,Math.trunc(e.limit)),100):25,a=async n=>{let y=n.slice(-r).reverse(),B=await Promise.all(y.map(async k=>{let O=await p(t,k);return O?H(k,O):{requestHash:k,unavailable:!0}}));return{requestsTotal:n.length,requests:B,truncated:n.length>y.length,newestFirst:!0}};if(s[0]==="requestHash"){let n=g(e.requestHash,"requestHash"),y=await p(t,n);if(!y)throw new i("No validation request has that requestHash.");return{registry:t,...H(n,y)}}if(s[0]==="validator")return{registry:t,validator:q(e.validator,"validator"),...await a(await w(t,"getValidatorRequests",[q(e.validator,"validator")]))};let u=T(e.agentId),l=Array.isArray(e.validators)?e.validators.map(n=>q(n,"validator")):[],h=S(e.tag,"tag",128),[c,o]=await Promise.all([w(t,"getAgentValidations",[u]),w(t,"getSummary",[u,l,h])]);return{registry:t,agentId:u.toString(),answeredCount:o[0].toString(),averageResponse:o[0]===0n?null:o[1],...await a(c),note:"The average counts only answered requests and includes whatever validators were asked; judge a result by who the validator is."}});return{tools:[W,Z,z]}};export{ae as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as qe,b as fe,g as Z,h as he,i as Be,m as ee,n as D,y as be,z as Oe}from"./GHPREYQK.js";import{b as y,c as Ie}from"./OFI3Y55L.js";import{a as le,b as z}from"./HTXKERNS.js";import{a as Q}from"./PBQSJSZO.js";import{a as $e}from"./BQICZFLR.js";import{a as Se}from"./5ZLOCQA4.js";import{c as me,g as P}from"./5KUWLUPM.js";import{a as Pe}from"./UP7FBDMJ.js";import{a as b,i as pe}from"./FWD4L3CJ.js";import{a as d}from"./XSD5NL7J.js";import{a as ce}from"./JXOEJPJ4.js";import{randomUUID as He}from"node:crypto";import{encodeAbiParameters as ne,encodeFunctionData as ke,erc20Abi as Te,getAddress as F,parseAbi as X,parseAbiParameters as oe,zeroAddress as K}from"viem";var Me=pe[b].pons,N=pe[b].ponsTrade,Re=X(["function getLaunchedToken(address) view returns ((address token,address curve,address deployer,address creatorFeeRecipient,address pairToken,uint256 graduationThreshold,uint24 poolFee,int24 tickSpacing,uint16 creatorTaxBps,bool buybackEnabled,uint8 phase,uint256 sweptQuote,uint256 sweptTokens,uint256 sweptAt,bool exists))"]),te=X(["function getReserves() view returns (uint256 quoteReserve,uint256 tokenReserve)","function feeBps() view returns (uint256)","function creatorTaxBps() view returns (uint256)","function currentSnipeTaxBps(address) view returns (uint256)","function sellableTokens() view returns (uint256)","function buy(uint256 quoteIn,uint256 minTokensOut,address recipient) payable returns (uint256)","function sell(uint256 tokensIn,uint256 minQuoteOut,address recipient) returns (uint256)"]),Le=X(["function quoteExactInputSingle(((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey,bool zeroForOne,uint128 exactAmount,bytes hookData) params) returns (uint256 amountOut,uint256 gasEstimate)"]),ze=X(["function execute(bytes commands,bytes[] inputs,uint256 deadline) payable"]),Ke=X(["function approve(address token,address spender,uint160 amount,uint48 expiration)"]),Xe=oe("((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey,bool zeroForOne,uint128 amountIn,uint128 amountOutMinimum,uint256 minHopPriceX36,bytes hookData)"),je={address:le,chainId:b,decimals:18,symbol:"ETH"},_e="There is no on-chain expiry. The signed transaction is protected by its minimum output.",Ge=`Quote expiry is enforced by Oak before signing only. ${_e}`,$=10000n,we=(1n<<256n)-1n,Ee=(1n<<128n)-1n,I=(n,t)=>({token:n,amount:t.toString()}),Ne=(n,t)=>(n+t-1n)/t,Ce="Reuse existing exact allowance";async function Ve(n,t,i,o,c){try{let e=await n.readContract({address:t,abi:Te,functionName:"allowance",args:[i,o],blockNumber:c});return typeof e=="bigint"?e:void 0}catch{return}}var We={type:"object",additionalProperties:!1,required:["token","amountIn"],properties:{token:{...me,description:"Pons launch token address on chain 4663."},amountIn:Se("Positive base units: the launch pair token for buy (native ETH wei for ETH pairs; pons_status shows pairToken), the launch token for sell."),pairToken:{...me,description:"The launch pair from pons_status. Required to buy a custom-pair launch, so amountIn is never read in the wrong units; omit or use the zero address for native ETH."},slippageBps:{type:"integer",minimum:0,maximum:9999,default:fe}}};function Qe(n,t,i,o){if(n===void 0){if(i&&y(t)!==K)throw new d(`This Pons launch is paired with ${o}; amountIn is in that token's base units. Repeat with pairToken "${t}" to confirm the input asset.`);return}if(typeof n!="string")throw new d("pairToken must be a token address.");if(Q(n),!P(y(n),y(t)))throw new Z(`This Pons launch trades only against ${o}.`)}async function De(n,t,i,o,{quoteOnly:c=!1,curveOnly:e=!1,blockNumber:p}={}){if(Q(i),Object.keys(t).some(f=>!["token","amountIn","slippageBps","pairToken"].includes(f)))throw new d("Provide only token, amountIn, optional pairToken and optional slippageBps.");if(typeof t.token!="string")throw new d("Provide a launch token address.");Q(t.token);let s=F(t.token),r=Pe(t.amountIn);if(r===0n||r>we)throw new d("Trade amount must be positive and within the uint256 range.");let m=t.slippageBps??fe;if(typeof m!="number"||!Number.isInteger(m)||m<0||m>=1e4)throw new d("Slippage must be an integer from 0 to 9999 basis points.");let x=f=>f*($-BigInt(m))/$,a=n.clientFor(b),l=p===void 0?await a.getBlock():await a.getBlock({blockNumber:p});if(p!==void 0&&l.number!==p)throw new d("Pons quote snapshot is unavailable.");let u=await a.readContract({address:Me.factory.address,abi:Re,functionName:"getLaunchedToken",args:[s],blockNumber:l.number});if(!u.exists||!P(u.token,s))throw new d("This address is not a Pons launch token.");if(e&&u.phase!==0)throw new Z("Pons curve quotes are only available before graduation.");if(u.phase===1)throw new d("Pons graduation is pending; the curve is closed and the pool is not ready.");if(u.phase===3)throw new d("This Pons launch was rescued and has no active trade route.");if(u.phase!==0&&u.phase!==2)throw new d("This Pons launch has an unknown trade phase.");let g=y(u.pairToken)===K,C=F(u.pairToken);if(P(C,s))throw new d("This Pons launch has an invalid pair.");let j=f=>Promise.all([a.readContract({address:f,abi:Te,functionName:"symbol",blockNumber:l.number}),a.readContract({address:f,abi:Te,functionName:"decimals",blockNumber:l.number})]),[[B,U],H]=await Promise.all([j(s),g?void 0:j(C)]),w=H?{address:C,chainId:b,symbol:ce(H[0]),decimals:H[1]}:je,G=g?"native ETH":`${w.symbol} (${w.address})`;Qe(t.pairToken,C,o,`${G}, ${w.decimals} decimals`);let V={address:s,chainId:b,symbol:ce(B),decimals:U},se=o?w:V,re=o?V:w,q=[],ie=(f,h,S,A)=>n.unsignedTx({to:f,data:h,value:S.toString(),chainId:b,description:A}),T,k,W,O=r,ge=null,ae,ve="";if(u.phase===0){let f=v=>a.readContract({address:u.curve,abi:te,functionName:v,blockNumber:l.number}),[[h,S],A,M,R,_]=await Promise.all([a.readContract({address:u.curve,abi:te,functionName:"getReserves",blockNumber:l.number}),f("feeBps"),f("creatorTaxBps"),o?a.readContract({address:u.curve,abi:te,functionName:"currentSnipeTaxBps",args:[i],blockNumber:l.number}):Promise.resolve(0n),o?f("sellableTokens"):Promise.resolve(0n)]);if(h<=0n||S<=0n||A+M>$-100n)throw new d("Pons curve reserves or fee settings are unavailable.");let J=$-A-M-100n,E=R<J?R:J,xe=v=>({base:v*A/$,creator:v*M/$,snipe:v*E/$}),Ae=v=>{let L=xe(v);return v-L.base-L.creator-L.snipe},Y;if(o){if(_<=0n||_>=S)throw new d("The curve has no available sellable tokens.");let v=Ae(r);if(T=v*S/(h+v),T>=_){T=_;let L=T*h/(S-T)+1n;O=Ne(L*$,$-A-M-E),O>r&&(O=r)}Y=O,k=x(T),W=Ne(k*r,O),g||q.push(n.approval(w.address,u.curve,r.toString(),b))}else Y=r*h/(S+r),T=Ae(Y),k=x(T),q.push(n.approval(s,u.curve,r.toString(),b));let de=xe(Y);ge={base:I(w,de.base),creator:I(w,de.creator),snipe:I(w,de.snipe)},ae=`Curve fees included: ${A} base, ${M} creator and ${E} opening-tax basis points, each rounded separately.`,q.push(ie(u.curve,ke({abi:te,functionName:o?"buy":"sell",args:[r,W??k,i]}),o&&g?r:0n,o?`Buy Pons curve tokens with ${G}.`:`Sell Pons curve tokens for ${G}.`))}else{if(r>Ee)throw new d("Trade amount exceeds the router uint128 range.");let f=Ie(u.pairToken,s,u.poolFee,u.tickSpacing),h=o?y(u.pairToken):s,S=o?s:y(u.pairToken),A=P(h,f.currency0);if(T=(await a.simulateContract({address:N.quoter.address,abi:Le,functionName:"quoteExactInputSingle",args:[{poolKey:f,zeroForOne:A,exactAmount:r,hookData:"0x"}],account:i,gas:$e,blockNumber:l.number})).result[0],k=x(T),k>Ee)throw new d("Minimum output exceeds the router uint128 range.");let R=l.timestamp+300n;if(R>=1n<<48n)throw new d("Permit2 expiry exceeds its timestamp range.");if(h!==K){let E=!c&&await Ve(a,h,i,N.permit2.address,l.number)===r;E||q.push(n.approval(h,N.permit2.address,r.toString(),b)),ve=E?`${Ce}: ${r} input base units already approved to Permit2. `:"",q.push(ie(N.permit2.address,ke({abi:Ke,functionName:"approve",args:[h,N.universal_router.address,r,Number(R)]}),0n,`${E?`${Ce}. `:""}Approve the exact token amount to the Pons router through Permit2 for five minutes.`))}let _=[ne(Xe,[{poolKey:f,zeroForOne:A,amountIn:r,amountOutMinimum:k,minHopPriceX36:0n,hookData:"0x"}]),ne(oe("address,uint256"),[h,r]),ne(oe("address,uint256"),[S,k])],J=ne(oe("bytes,bytes[]"),["0x060c0f",_]);q.push(ie(N.universal_router.address,ke({abi:ze,functionName:"execute",args:["0x10",[J],R]}),h===K?r:0n,"Trade through Pons Universal Router v2.1.2.")),ae="Quoter output is net of Pons hook fees; no additional fee is subtracted."}if(T<=0n||k<=0n||k>we||(W??k)>we)throw new d("Trade output or minimum is outside the supported positive range.");let ye=c?{changes:[],summary:"Quote only; preview is required before sending."}:await n.preview(q,i),ue=r-O;return{txs:q,changes:ye.changes,summary:`${o?"Buy":"Sell"} ${V.symbol} (${V.address}) on chain ${b}${g?"":` ${o?"with":"for"} ${G}`}. ${ae} ${ve}${u.phase===0?`${_e} `:""}${ue>0n?`Expected ${g?"native refund":"refund"}: ${n.formatAmount(ue.toString(),w.decimals)} ${w.symbol}; minimum output uses the expected spend after refund. `:""}${ye.summary}`,pairToken:w,quote:{phase:u.phase,amountIn:I(se,r),amountOut:I(re,T),minAmountOut:I(re,k),minimumKind:"absolute",calldataMinAmountOut:I(re,W??k),expectedSpend:I(se,O),expectedRefund:I(se,ue),fees:ge,blockNumber:l.number.toString(),blockTimestamp:l.timestamp.toString()}}}function ln(n){return Fe(n,!0)}function Fe(n,t=!1,i){let o=new Map,c=e=>{if(BigInt(ee())>=BigInt(e.expiresAt))throw new he};return{name:"pons",async quote(e,p){if(e={...e,from:z(e.from),to:z(e.to)},D(e.from)&&D(e.to))throw new Z("Pons quotes require a launch token and its pair token.");let s=D(e.from)||!D(e.to)&&await Je(n,e.from,e.to,i),r=ee(),m=await De(n,{token:s?e.to:e.from,amountIn:e.amountIn,slippageBps:e.slippageBps,pairToken:y(s?e.from:e.to)},p,s,{quoteOnly:!0,curveOnly:t,blockNumber:i}),x=m.txs.at(-1),a=m.quote,l=String(BigInt(i===void 0?r:a.blockTimestamp)+BigInt(qe)),u=a.minAmountOut.amount,g=a.fees,C=D(m.pairToken.address)?"native ETH base units (18 decimals)":`${m.pairToken.symbol} (${m.pairToken.address}) base units (${m.pairToken.decimals} decimals)`,j=g?`Pons curve fees included in net output: ${g.base.amount} base, ${g.creator.amount} creator and ${g.snipe.amount} opening tax, in ${C}. Oak swap fee: 0 (venue fee is never Oak income). ${Ge}`:"Quoter output is net of Pons hook fees; no additional fee is subtracted. Oak swap fee: 0.",B=Oe({...e,quoteId:`pons:${He()}`,provider:"pons",wallet:p,chainId:b,router:x.to,spender:a.phase===0?x.to:N.permit2.address,expiresAt:l,data:x.data,value:x.value,amountOut:a.amountOut.amount,minAmountOut:u,blockNumber:a.blockNumber,...a.phase===0?{ponsCurveToken:s?e.to:e.from,calldataMinAmountOut:a.calldataMinAmountOut.amount}:{ponsPoolToken:s?e.to:e.from},expectedSpend:a.expectedSpend.amount,expectedRefund:a.expectedRefund.amount,feeDisclosure:j,oakFee:"0"});be(x,B),c(B);for(let[U,H]of o)BigInt(ee())>=BigInt(H.quote.expiresAt)&&o.delete(U);for(;o.size>=Be;)o.delete(o.keys().next().value);return o.set(B.quoteId,{quote:{...B},txs:m.txs.map(U=>({...U})),summary:m.summary}),B},async build(e,p){let s=o.get(e);if(!s)throw new he;if(c(s.quote),Q(p),!P(p,s.quote.wallet))throw new d("Quote was issued for a different wallet.");let r=s.txs.map(a=>({...a}));be(r.at(-1),s.quote);let m=await n.preview(r,p);if(c(s.quote),m.changes.filter(a=>P(z(a.token.address),z(s.quote.to))).reduce((a,l)=>a+BigInt(l.amount),0n)<BigInt(s.quote.minAmountOut))throw new d("Preview retained output is below the accepted minimum.");return{txs:r,summary:`${s.summary} ${m.summary} ${s.quote.feeDisclosure}`}}}}async function Ue(n,t,i){return n.clientFor(b).readContract({address:Me.factory.address,abi:Re,functionName:"getLaunchedToken",args:[F(t)],...i===void 0?{}:{blockNumber:i}})}async function Je(n,t,i,o){let c=await Ue(n,i,o);return c.exists&&P(c.token,i)&&P(y(c.pairToken),y(t))}async function fn(n,t,i,o,c){if(typeof i.token!="string")throw new d("Provide a launch token address.");Q(i.token);let e=F(i.token),p=await Ue(n,e,c);if(!p.exists||!P(p.token,e))throw new d("This address is not a Pons launch token.");let s=y(p.pairToken)===K?le:F(p.pairToken);return Qe(i.pairToken,F(p.pairToken),t,s),{quote:await Fe(n,!1,c).quote({from:t?s:e,to:t?e:s,amountIn:String(i.amountIn),...i.slippageBps===void 0?{}:{slippageBps:i.slippageBps}},o),input:t?s:e}}var Ye=n=>({tools:[!0,!1].map(t=>({name:t?"pons_buy":"pons_sell",inputSchema:We,async execute(i,o){try{return await De(n,i,o,t)}catch(c){throw new d(n.plainError(c))}}}))}),hn=Ye;export{ln as a,Fe as b,fn as c,Ye as d,hn as e};
|
|
1
|
+
import{a as qe,b as fe,g as Z,h as he,i as Be,m as ee,n as D,y as be,z as Oe}from"./3NJ5KQ3Q.js";import{b as y,c as Ie}from"./ZQAFFWDK.js";import{a as le,b as z}from"./3MLUCYCB.js";import{a as Q}from"./43LI5NKJ.js";import{a as $e}from"./IOYRL6AY.js";import{a as Se}from"./66F5ZH34.js";import{c as me,g as P}from"./NWNYJ26T.js";import{b as Pe}from"./IX3GZMTM.js";import{a as b,i as pe}from"./FWD4L3CJ.js";import{a as d}from"./XSD5NL7J.js";import{a as ce}from"./JXOEJPJ4.js";import{randomUUID as He}from"node:crypto";import{encodeAbiParameters as ne,encodeFunctionData as ke,erc20Abi as Te,getAddress as F,parseAbi as X,parseAbiParameters as oe,zeroAddress as K}from"viem";var Me=pe[b].pons,N=pe[b].ponsTrade,Re=X(["function getLaunchedToken(address) view returns ((address token,address curve,address deployer,address creatorFeeRecipient,address pairToken,uint256 graduationThreshold,uint24 poolFee,int24 tickSpacing,uint16 creatorTaxBps,bool buybackEnabled,uint8 phase,uint256 sweptQuote,uint256 sweptTokens,uint256 sweptAt,bool exists))"]),te=X(["function getReserves() view returns (uint256 quoteReserve,uint256 tokenReserve)","function feeBps() view returns (uint256)","function creatorTaxBps() view returns (uint256)","function currentSnipeTaxBps(address) view returns (uint256)","function sellableTokens() view returns (uint256)","function buy(uint256 quoteIn,uint256 minTokensOut,address recipient) payable returns (uint256)","function sell(uint256 tokensIn,uint256 minQuoteOut,address recipient) returns (uint256)"]),Le=X(["function quoteExactInputSingle(((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey,bool zeroForOne,uint128 exactAmount,bytes hookData) params) returns (uint256 amountOut,uint256 gasEstimate)"]),ze=X(["function execute(bytes commands,bytes[] inputs,uint256 deadline) payable"]),Ke=X(["function approve(address token,address spender,uint160 amount,uint48 expiration)"]),Xe=oe("((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey,bool zeroForOne,uint128 amountIn,uint128 amountOutMinimum,uint256 minHopPriceX36,bytes hookData)"),je={address:le,chainId:b,decimals:18,symbol:"ETH"},_e="There is no on-chain expiry. The signed transaction is protected by its minimum output.",Ge=`Quote expiry is enforced by Oak before signing only. ${_e}`,$=10000n,we=(1n<<256n)-1n,Ee=(1n<<128n)-1n,I=(n,t)=>({token:n,amount:t.toString()}),Ne=(n,t)=>(n+t-1n)/t,Ce="Reuse existing exact allowance";async function Ve(n,t,i,o,c){try{let e=await n.readContract({address:t,abi:Te,functionName:"allowance",args:[i,o],blockNumber:c});return typeof e=="bigint"?e:void 0}catch{return}}var We={type:"object",additionalProperties:!1,required:["token","amountIn"],properties:{token:{...me,description:"Pons launch token address on chain 4663."},amountIn:Se("Positive base units: the launch pair token for buy (native ETH wei for ETH pairs; pons_status shows pairToken), the launch token for sell."),pairToken:{...me,description:"The launch pair from pons_status. Required to buy a custom-pair launch, so amountIn is never read in the wrong units; omit or use the zero address for native ETH."},slippageBps:{type:"integer",minimum:0,maximum:9999,default:fe}}};function Qe(n,t,i,o){if(n===void 0){if(i&&y(t)!==K)throw new d(`This Pons launch is paired with ${o}; amountIn is in that token's base units. Repeat with pairToken "${t}" to confirm the input asset.`);return}if(typeof n!="string")throw new d("pairToken must be a token address.");if(Q(n),!P(y(n),y(t)))throw new Z(`This Pons launch trades only against ${o}.`)}async function De(n,t,i,o,{quoteOnly:c=!1,curveOnly:e=!1,blockNumber:p}={}){if(Q(i),Object.keys(t).some(f=>!["token","amountIn","slippageBps","pairToken"].includes(f)))throw new d("Provide only token, amountIn, optional pairToken and optional slippageBps.");if(typeof t.token!="string")throw new d("Provide a launch token address.");Q(t.token);let s=F(t.token),r=Pe(t.amountIn);if(r===0n||r>we)throw new d("Trade amount must be positive and within the uint256 range.");let m=t.slippageBps??fe;if(typeof m!="number"||!Number.isInteger(m)||m<0||m>=1e4)throw new d("Slippage must be an integer from 0 to 9999 basis points.");let x=f=>f*($-BigInt(m))/$,a=n.clientFor(b),l=p===void 0?await a.getBlock():await a.getBlock({blockNumber:p});if(p!==void 0&&l.number!==p)throw new d("Pons quote snapshot is unavailable.");let u=await a.readContract({address:Me.factory.address,abi:Re,functionName:"getLaunchedToken",args:[s],blockNumber:l.number});if(!u.exists||!P(u.token,s))throw new d("This address is not a Pons launch token.");if(e&&u.phase!==0)throw new Z("Pons curve quotes are only available before graduation.");if(u.phase===1)throw new d("Pons graduation is pending; the curve is closed and the pool is not ready.");if(u.phase===3)throw new d("This Pons launch was rescued and has no active trade route.");if(u.phase!==0&&u.phase!==2)throw new d("This Pons launch has an unknown trade phase.");let g=y(u.pairToken)===K,C=F(u.pairToken);if(P(C,s))throw new d("This Pons launch has an invalid pair.");let j=f=>Promise.all([a.readContract({address:f,abi:Te,functionName:"symbol",blockNumber:l.number}),a.readContract({address:f,abi:Te,functionName:"decimals",blockNumber:l.number})]),[[B,U],H]=await Promise.all([j(s),g?void 0:j(C)]),w=H?{address:C,chainId:b,symbol:ce(H[0]),decimals:H[1]}:je,G=g?"native ETH":`${w.symbol} (${w.address})`;Qe(t.pairToken,C,o,`${G}, ${w.decimals} decimals`);let V={address:s,chainId:b,symbol:ce(B),decimals:U},se=o?w:V,re=o?V:w,q=[],ie=(f,h,S,A)=>n.unsignedTx({to:f,data:h,value:S.toString(),chainId:b,description:A}),T,k,W,O=r,ge=null,ae,ve="";if(u.phase===0){let f=v=>a.readContract({address:u.curve,abi:te,functionName:v,blockNumber:l.number}),[[h,S],A,M,R,_]=await Promise.all([a.readContract({address:u.curve,abi:te,functionName:"getReserves",blockNumber:l.number}),f("feeBps"),f("creatorTaxBps"),o?a.readContract({address:u.curve,abi:te,functionName:"currentSnipeTaxBps",args:[i],blockNumber:l.number}):Promise.resolve(0n),o?f("sellableTokens"):Promise.resolve(0n)]);if(h<=0n||S<=0n||A+M>$-100n)throw new d("Pons curve reserves or fee settings are unavailable.");let J=$-A-M-100n,E=R<J?R:J,xe=v=>({base:v*A/$,creator:v*M/$,snipe:v*E/$}),Ae=v=>{let L=xe(v);return v-L.base-L.creator-L.snipe},Y;if(o){if(_<=0n||_>=S)throw new d("The curve has no available sellable tokens.");let v=Ae(r);if(T=v*S/(h+v),T>=_){T=_;let L=T*h/(S-T)+1n;O=Ne(L*$,$-A-M-E),O>r&&(O=r)}Y=O,k=x(T),W=Ne(k*r,O),g||q.push(n.approval(w.address,u.curve,r.toString(),b))}else Y=r*h/(S+r),T=Ae(Y),k=x(T),q.push(n.approval(s,u.curve,r.toString(),b));let de=xe(Y);ge={base:I(w,de.base),creator:I(w,de.creator),snipe:I(w,de.snipe)},ae=`Curve fees included: ${A} base, ${M} creator and ${E} opening-tax basis points, each rounded separately.`,q.push(ie(u.curve,ke({abi:te,functionName:o?"buy":"sell",args:[r,W??k,i]}),o&&g?r:0n,o?`Buy Pons curve tokens with ${G}.`:`Sell Pons curve tokens for ${G}.`))}else{if(r>Ee)throw new d("Trade amount exceeds the router uint128 range.");let f=Ie(u.pairToken,s,u.poolFee,u.tickSpacing),h=o?y(u.pairToken):s,S=o?s:y(u.pairToken),A=P(h,f.currency0);if(T=(await a.simulateContract({address:N.quoter.address,abi:Le,functionName:"quoteExactInputSingle",args:[{poolKey:f,zeroForOne:A,exactAmount:r,hookData:"0x"}],account:i,gas:$e,blockNumber:l.number})).result[0],k=x(T),k>Ee)throw new d("Minimum output exceeds the router uint128 range.");let R=l.timestamp+300n;if(R>=1n<<48n)throw new d("Permit2 expiry exceeds its timestamp range.");if(h!==K){let E=!c&&await Ve(a,h,i,N.permit2.address,l.number)===r;E||q.push(n.approval(h,N.permit2.address,r.toString(),b)),ve=E?`${Ce}: ${r} input base units already approved to Permit2. `:"",q.push(ie(N.permit2.address,ke({abi:Ke,functionName:"approve",args:[h,N.universal_router.address,r,Number(R)]}),0n,`${E?`${Ce}. `:""}Approve the exact token amount to the Pons router through Permit2 for five minutes.`))}let _=[ne(Xe,[{poolKey:f,zeroForOne:A,amountIn:r,amountOutMinimum:k,minHopPriceX36:0n,hookData:"0x"}]),ne(oe("address,uint256"),[h,r]),ne(oe("address,uint256"),[S,k])],J=ne(oe("bytes,bytes[]"),["0x060c0f",_]);q.push(ie(N.universal_router.address,ke({abi:ze,functionName:"execute",args:["0x10",[J],R]}),h===K?r:0n,"Trade through Pons Universal Router v2.1.2.")),ae="Quoter output is net of Pons hook fees; no additional fee is subtracted."}if(T<=0n||k<=0n||k>we||(W??k)>we)throw new d("Trade output or minimum is outside the supported positive range.");let ye=c?{changes:[],summary:"Quote only; preview is required before sending."}:await n.preview(q,i),ue=r-O;return{txs:q,changes:ye.changes,summary:`${o?"Buy":"Sell"} ${V.symbol} (${V.address}) on chain ${b}${g?"":` ${o?"with":"for"} ${G}`}. ${ae} ${ve}${u.phase===0?`${_e} `:""}${ue>0n?`Expected ${g?"native refund":"refund"}: ${n.formatAmount(ue.toString(),w.decimals)} ${w.symbol}; minimum output uses the expected spend after refund. `:""}${ye.summary}`,pairToken:w,quote:{phase:u.phase,amountIn:I(se,r),amountOut:I(re,T),minAmountOut:I(re,k),minimumKind:"absolute",calldataMinAmountOut:I(re,W??k),expectedSpend:I(se,O),expectedRefund:I(se,ue),fees:ge,blockNumber:l.number.toString(),blockTimestamp:l.timestamp.toString()}}}function ln(n){return Fe(n,!0)}function Fe(n,t=!1,i){let o=new Map,c=e=>{if(BigInt(ee())>=BigInt(e.expiresAt))throw new he};return{name:"pons",async quote(e,p){if(e={...e,from:z(e.from),to:z(e.to)},D(e.from)&&D(e.to))throw new Z("Pons quotes require a launch token and its pair token.");let s=D(e.from)||!D(e.to)&&await Je(n,e.from,e.to,i),r=ee(),m=await De(n,{token:s?e.to:e.from,amountIn:e.amountIn,slippageBps:e.slippageBps,pairToken:y(s?e.from:e.to)},p,s,{quoteOnly:!0,curveOnly:t,blockNumber:i}),x=m.txs.at(-1),a=m.quote,l=String(BigInt(i===void 0?r:a.blockTimestamp)+BigInt(qe)),u=a.minAmountOut.amount,g=a.fees,C=D(m.pairToken.address)?"native ETH base units (18 decimals)":`${m.pairToken.symbol} (${m.pairToken.address}) base units (${m.pairToken.decimals} decimals)`,j=g?`Pons curve fees included in net output: ${g.base.amount} base, ${g.creator.amount} creator and ${g.snipe.amount} opening tax, in ${C}. Oak swap fee: 0 (venue fee is never Oak income). ${Ge}`:"Quoter output is net of Pons hook fees; no additional fee is subtracted. Oak swap fee: 0.",B=Oe({...e,quoteId:`pons:${He()}`,provider:"pons",wallet:p,chainId:b,router:x.to,spender:a.phase===0?x.to:N.permit2.address,expiresAt:l,data:x.data,value:x.value,amountOut:a.amountOut.amount,minAmountOut:u,blockNumber:a.blockNumber,...a.phase===0?{ponsCurveToken:s?e.to:e.from,calldataMinAmountOut:a.calldataMinAmountOut.amount}:{ponsPoolToken:s?e.to:e.from},expectedSpend:a.expectedSpend.amount,expectedRefund:a.expectedRefund.amount,feeDisclosure:j,oakFee:"0"});be(x,B),c(B);for(let[U,H]of o)BigInt(ee())>=BigInt(H.quote.expiresAt)&&o.delete(U);for(;o.size>=Be;)o.delete(o.keys().next().value);return o.set(B.quoteId,{quote:{...B},txs:m.txs.map(U=>({...U})),summary:m.summary}),B},async build(e,p){let s=o.get(e);if(!s)throw new he;if(c(s.quote),Q(p),!P(p,s.quote.wallet))throw new d("Quote was issued for a different wallet.");let r=s.txs.map(a=>({...a}));be(r.at(-1),s.quote);let m=await n.preview(r,p);if(c(s.quote),m.changes.filter(a=>P(z(a.token.address),z(s.quote.to))).reduce((a,l)=>a+BigInt(l.amount),0n)<BigInt(s.quote.minAmountOut))throw new d("Preview retained output is below the accepted minimum.");return{txs:r,summary:`${s.summary} ${m.summary} ${s.quote.feeDisclosure}`}}}}async function Ue(n,t,i){return n.clientFor(b).readContract({address:Me.factory.address,abi:Re,functionName:"getLaunchedToken",args:[F(t)],...i===void 0?{}:{blockNumber:i}})}async function Je(n,t,i,o){let c=await Ue(n,i,o);return c.exists&&P(c.token,i)&&P(y(c.pairToken),y(t))}async function fn(n,t,i,o,c){if(typeof i.token!="string")throw new d("Provide a launch token address.");Q(i.token);let e=F(i.token),p=await Ue(n,e,c);if(!p.exists||!P(p.token,e))throw new d("This address is not a Pons launch token.");let s=y(p.pairToken)===K?le:F(p.pairToken);return Qe(i.pairToken,F(p.pairToken),t,s),{quote:await Fe(n,!1,c).quote({from:t?s:e,to:t?e:s,amountIn:String(i.amountIn),...i.slippageBps===void 0?{}:{slippageBps:i.slippageBps}},o),input:t?s:e}}var Ye=n=>({tools:[!0,!1].map(t=>({name:t?"pons_buy":"pons_sell",inputSchema:We,async execute(i,o){try{return await De(n,i,o,t)}catch(c){throw new d(n.plainError(c))}}}))}),hn=Ye;export{ln as a,Fe as b,fn as c,Ye as d,hn as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c,b as T,e as v,f as F,g as I}from"./
|
|
1
|
+
import{a as c,b as T,e as v,f as F,g as I}from"./T2WHOZXM.js";import{a as l}from"./66F5ZH34.js";import{c as A,g,h as S}from"./NWNYJ26T.js";import{a as h}from"./FWD4L3CJ.js";import{a as d}from"./XSD5NL7J.js";import{encodeFunctionData as y,getAddress as M,parseAbi as j,parseAbiItem as D,zeroAddress as H}from"viem";var x=M("0x000000001f26a0044baa66024e7b6599c61963f8"),_=D("event AuctionCreated(address indexed auction,address indexed token,uint256 amount,bytes configData)"),n=j(["function currency() view returns (address)","function token() view returns (address)","function startBlock() view returns (uint64)","function endBlock() view returns (uint64)","function claimBlock() view returns (uint64)","function validationHook() view returns (address)","function clearingPrice() view returns (uint256)","function isGraduated() view returns (bool)","function bids(uint256) view returns ((uint64 startBlock,uint24 startCumulativeMps,uint64 exitedBlock,uint256 maxPrice,address owner,uint256 amountQ96,uint256 tokensFilled))","function submitBid(uint256 maxPrice,uint128 amount,address owner,uint256 prevTickPrice,bytes hookData) payable returns (uint256)","function exitBid(uint256)","function exitPartiallyFilledBid(uint256,uint64,uint64)","function claimTokens(uint256)","function claimTokensBatch(address,uint256[])","function checkpoint()","function sweepCurrency()","function sweepUnsoldTokens()"]);async function $(s,B){let o=T(B.auction),t=c(B.creationBlock,"creationBlock",64,!0),e=await s.getLogs({address:x,event:_,args:{auction:o},fromBlock:t,toBlock:t,strict:!0});if(e.length!==1||!g(e[0].address,x)||!S(e[0].args.auction,o))throw new d("Auction has no matching AuctionCreated event at the pinned CCA factory and creationBlock.");return o}async function Q(s,B){let o=s.clientFor(h),t=await $(o,B),e=await o.getBlockNumber(),[a,k,i,b,m,C,u,w]=await Promise.all([o.readContract({address:t,abi:n,functionName:"currency",blockNumber:e}),o.readContract({address:t,abi:n,functionName:"token",blockNumber:e}),o.readContract({address:t,abi:n,functionName:"startBlock",blockNumber:e}),o.readContract({address:t,abi:n,functionName:"endBlock",blockNumber:e}),o.readContract({address:t,abi:n,functionName:"claimBlock",blockNumber:e}),o.readContract({address:t,abi:n,functionName:"validationHook",blockNumber:e}),o.readContract({address:t,abi:n,functionName:"clearingPrice",blockNumber:e}),o.readContract({address:t,abi:n,functionName:"isGraduated",blockNumber:e})]);return{auction:t,currency:a,saleToken:k,startBlock:i,endBlock:b,claimBlock:m,validationHook:C,clearingPrice:u,graduated:w,blockNumber:e}}var U={auction:A,creationBlock:l(),bidId:l(),amount:l(),maxPrice:l(),prevTickPrice:l(),lastFullyFilledCheckpointBlock:l(),outbidBlock:l(),mode:{type:"string",enum:["full","partial"]},bidIds:{type:"array",minItems:1,maxItems:50,items:l()}};function R(s){let o=["status","bid","exit","claim","checkpoint","sweep_currency","sweep_tokens"].map(t=>({name:`uniswap_auction_${t}`,inputSchema:{type:"object",additionalProperties:!1,required:["auction","creationBlock",...t==="bid"?["amount","maxPrice","prevTickPrice"]:t==="exit"?["bidId","mode"]:[]],properties:U},async execute(e,a){I(e,["auction","creationBlock",...t==="bid"?["amount","maxPrice","prevTickPrice"]:t==="exit"?["bidId","mode","lastFullyFilledCheckpointBlock","outbidBlock"]:t==="claim"?["bidId","bidIds"]:t==="status"?["bidId"]:[]]);let i=await Q(s,e),b=s.clientFor(h),[m,C]=await Promise.all([v(s,i.currency,i.blockNumber),v(s,i.saleToken,i.blockNumber)]),u=e.bidId===void 0?void 0:await b.readContract({address:i.auction,abi:n,functionName:"bids",args:[c(e.bidId,"bidId",256,!0)],blockNumber:i.blockNumber});if(t==="status")return{auction:i.auction,paymentToken:m,saleToken:C,startBlock:i.startBlock.toString(),endBlock:i.endBlock.toString(),claimBlock:i.claimBlock.toString(),validationHook:i.validationHook,clearingPrice:i.clearingPrice.toString(),graduated:i.graduated,...u?{bid:{...u,startBlock:u.startBlock.toString(),exitedBlock:u.exitedBlock.toString(),maxPrice:u.maxPrice.toString(),amountQ96:u.amountQ96.toString(),tokensFilled:u.tokensFilled.toString()}}:{},summary:"CCA prices use currency-base-units per sale-token-base-unit in Q96. Clearing price/graduation reflect the latest checkpoint and may lag the head."};let w=[],f,N=0n;if(t==="bid"){if(i.validationHook!==H)throw new d("This auction has a validation hook. Its validation/signing contract is not configured; do not pass an off-chain signature manually.");if(i.blockNumber<i.startBlock||i.blockNumber>=i.endBlock)throw new d("Auction is not in its bidding window.");let r=c(e.amount,"amount",128),p=c(e.maxPrice,"maxPrice"),P=c(e.prevTickPrice,"prevTickPrice",256,!0);if(p<=i.clearingPrice)throw new d("Bid maxPrice must be above the checkpoint clearing price.");i.currency===H?N=r:w.push(s.approval(i.currency,i.auction,r.toString(),h)),f=y({abi:n,functionName:"submitBid",args:[p,r,a,P,"0x"]})}else if(t==="exit"){if(!u||!g(u.owner,a))throw new d("Only exit a bid owned by the signing wallet.");let r=c(e.bidId,"bidId",256,!0);if(e.mode==="full"){if(e.lastFullyFilledCheckpointBlock!==void 0||e.outbidBlock!==void 0)throw new d("Full exit takes no checkpoint hints.");f=y({abi:n,functionName:"exitBid",args:[r]})}else if(e.mode==="partial")f=y({abi:n,functionName:"exitPartiallyFilledBid",args:[r,c(e.lastFullyFilledCheckpointBlock,"lastFullyFilledCheckpointBlock",64,!0),c(e.outbidBlock,"outbidBlock",64,!0)]});else throw new d("Choose full or partial exit explicitly; partial exits require checkpoint hints.")}else if(t==="claim"){if(e.bidId===void 0==(e.bidIds===void 0))throw new d("Provide bidId or bidIds, not both.");let r=e.bidIds===void 0?[c(e.bidId,"bidId",256,!0)]:Array.isArray(e.bidIds)?e.bidIds.map(p=>c(p,"bidIds",256,!0)):[];if(r.length<1||r.length>50||new Set(r.map(String)).size!==r.length)throw new d("Provide 1 to 50 unique bid IDs.");for(let p of r){let P=await b.readContract({address:i.auction,abi:n,functionName:"bids",args:[p],blockNumber:i.blockNumber});if(!g(P.owner,a))throw new d("Claimed tokens must belong to the signing wallet.")}f=y({abi:n,functionName:"claimTokensBatch",args:[a,r]})}else f=y({abi:n,functionName:t==="checkpoint"?"checkpoint":t==="sweep_currency"?"sweepCurrency":"sweepUnsoldTokens"});return w.push(s.unsignedTx({to:i.auction,data:f,value:N.toString(),chainId:h,description:`CCA ${t} on factory-verified auction ${i.auction}. Bid owner ${a}.`})),F(s,w,a,`CCA ${t}; checkpoint/exit/claim eligibility and creator-only sweeps are checked by the contract in preview. Sweeps pay the auction's immutable funds/tokens recipient, not an arbitrary recipient.`)}}));return o.push({name:"uniswap_auctions",inputSchema:{type:"object",additionalProperties:!1,properties:{fromBlock:l(),toBlock:l()}},async execute(t){I(t,["fromBlock","toBlock"]);let e=s.clientFor(h),a=await e.getBlockNumber(),k=t.fromBlock===void 0?a>9999n?a-9999n:0n:c(t.fromBlock,"fromBlock",64,!0),i=t.toBlock===void 0?a:c(t.toBlock,"toBlock",64,!0);if(k>i||i>a||i-k>=10000n)throw new d("Scan an ordered range of at most 10000 blocks, ending at or before the head.");let b=await e.getLogs({address:x,event:_,fromBlock:k,toBlock:i,strict:!0});return{factory:x,fromBlock:k.toString(),toBlock:i.toString(),auctions:b.map(m=>({auction:m.args.auction,token:m.args.token,amount:m.args.amount.toString(),creationBlock:m.blockNumber.toString()})),summary:"Factory-verified auctions in this block window only. An empty result does not establish that no auctions exist outside it. Scan earlier windows for older launches."}}}),{tools:o}}export{x as a,_ as b,n as c,$ as d,Q as e,R as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as le,s as D,x as W}from"./WPAF55SP.js";import{d as fe}from"./NA7R6J5N.js";import{a as me,b as ee,c as de,e as oe,f as ye,g as pe,h as V,i as b,j as g,l as M,m as N,o as U,p as B,q as T,s as O,u as E,v as _}from"./YEXUSRIZ.js";import{b as G,g as K,h as X,i as se,j as ue}from"./MQK6OP7S.js";import{c as Z}from"./5KUWLUPM.js";import{a as i}from"./XSD5NL7J.js";import{encodeAbiParameters as Oe,getAddress as we,keccak256 as Ke,parseAbi as Ve,toHex as ae,zeroAddress as je}from"viem";import{encodeAbiParameters as ge,encodePacked as Ce,getAddress as Ae,keccak256 as te,parseAbi as Fe,toHex as Le,zeroAddress as ke}from"viem";var Re=1n<<256n,ve=1n<<128n,Ue=Fe(["function extsload(bytes32[] slots) view returns (bytes32[])"]),$=(o,n)=>({type:"object",additionalProperties:!1,properties:o,required:n}),qe={oneOf:[$({kind:{const:"family"},launcher:Z,familyId:ee,member:{type:"string",enum:["0","1","2","3","4","5","6","7"]}},["kind","launcher","familyId","member"]),$({kind:{const:"nft"},tokenId:me},["kind","tokenId"]),$({kind:{const:"agent-account"},account:Z,positionId:ee},["kind","account","positionId"])]};function Ne(o){let n=N(o);if(n.kind!=="family")throw new i("This step supports Launcher family positions only. NFT and agent-account position reads are reserved for a later integration.");oe(n,["kind","launcher","familyId","member"],["kind","launcher","familyId","member"]);let e=ye(n.member,8);if(e>7n)throw new i("Hookr family member must be a decimal string from 0 to 7.");return{kind:"family",launcher:ue(n.launcher),familyId:V(n.familyId),member:e.toString()}}var C=o=>Le(BigInt.asUintN(256,o),{size:32}),ne=(o,n)=>te(ge([{type:"bytes32"},{type:"bytes32"}],[o,n]));function re(o,n,e,a,r,H){let w=ne(o,C(6n)),P=m=>ne(C(BigInt(m)),C(BigInt(w)+4n)),y=te(ge([{type:"bytes32"},{type:"uint8"}],[e,a])),c=te(Ce(["address","int24","int24","bytes32"],[n,r,H,y])),u=ne(c,C(BigInt(w)+6n));return[w,C(BigInt(w)+1n),C(BigInt(w)+2n),C(BigInt(P(r))+1n),C(BigInt(P(r))+2n),C(BigInt(P(H))+1n),C(BigInt(P(H))+2n),u,C(BigInt(u)+1n),C(BigInt(u)+2n)]}function Q(o,n,e,a,r,H){return BigInt.asUintN(256,a<r?n-e:a>=H?e-n:o-n-e)}function J(o,n,e){if(o<0n||o>=1n<<128n||[n,e].some(a=>a<0n||a>=Re))throw new i("Hookr fee inputs are outside the verified v4 layout.");return o*BigInt.asUintN(256,n-e)/ve}function ie(o){let n=N(o),e={currency0:b(n.currency0),currency1:b(n.currency1),fee:Number(g(n.fee,24)),tickSpacing:Number(g(n.tickSpacing,24)),hooks:b(n.hooks)};if(BigInt(e.currency0)>=BigInt(e.currency1)||e.fee!==8388608||e.hooks!==T||e.tickSpacing<1||e.tickSpacing>32767)throw new i("Hookr family PoolKey is not a supported Root dynamic-fee pool.");return e}async function Te(o,n,e,a){let r=await X(o,a),H={},w=new Set,P=(t,k=[])=>B(o,e.launcher,U(e.launcher===Ae(G.launcherV1)?"launcherV1":"launcher"),t,k,r.number),y=async(t,k)=>{try{return await k()}catch(S){return H[t]=S instanceof i?S.message:`Hookr ${t} read failed at block ${r.number}. Retry the named-block read; no zero or empty result is implied.`,null}},c={chainId:4663,blockNumber:r.number.toString(),blockHash:r.hash,position:e,owner:null,ownedByWallet:null,poolId:null,poolKey:null,range:null,liquidity:null,tokens:null,principal:null,uncollectedLpFees:null,collectedLpFees:null,claimableCoreCredits:null,poolPendingRecapture:null,inRange:null,gateStatus:null,locks:null},u=async()=>(await se(o,r),{...c,readStatus:{status:Object.keys(H).length?"partial":"complete",reasons:H},warnings:["collectedLpFees is null: no complete collection-history reconstruction is available in this step.","LP fees can include donations already released into v4 fee growth. Pending recapture is pool-level, unallocated and excluded from LP fees.","Principal is current withdrawable token inventory before fees, gas or price changes; it is not the original deposit value."]});if(await y("pins",async()=>(await K(o,r.number,[e.launcher,T,O],w),!0))===null)return u();let m=await y("owner",async()=>{let t=b(await P("familyOwner",[e.familyId]));if(t===ke)throw new i("Hookr family does not exist at this block. Check its Launcher and family ID.");return t});if(m===null)return u();c.owner=m,c.ownedByWallet=m===n;let R=await y("position",async()=>{let[t,k,S]=await Promise.all([P("memberCount",[e.familyId]),P("position",[e.familyId,Number(e.member)]),P("poolManager")]);if(S!==O||g(t,8)>8n||BigInt(e.member)>=g(t,8))throw new i("Hookr family member or PoolManager is invalid.");let h=N(k),d=ie(h.key);if(typeof h.tickLower!="number"||typeof h.tickUpper!="number")throw new i("Hookr position range is incomplete.");W(h.tickLower,h.tickUpper,d.tickSpacing);let s=g(h.liquidity,128),L=D(d);if(await P("poolFamily",[L])!==e.familyId)throw new i("Hookr pool does not belong to this family.");return{key:d,id:L,tickLower:h.tickLower,tickUpper:h.tickUpper,liquidity:s}});if(R===null)return u();let{key:l,id:p,tickLower:A,tickUpper:I,liquidity:v}=R;c.poolKey=l,c.poolId=p,c.range={tickLower:A,tickUpper:I},c.liquidity=v.toString();let[f,q,F]=await Promise.all([y("tokens",()=>Promise.all([_(o,l.currency0,r.number),_(o,l.currency1,r.number)])),y("feeGrowth",async()=>{let t=re(p,e.launcher,e.familyId,Number(e.member),A,I),k=await B(o,O,Ue,"extsload",[t],r.number),S=M(k,10).map(Be=>BigInt(V(Be))),[h,d,s,L,Y,x,j,Pe,Ie,Se]=S,ce=h&(1n<<160n)-1n,z=Number(BigInt.asIntN(24,h>>160n));if(ce===0n||z<-887272||z>887272||Pe!==v)throw new i("Hookr PoolManager position is uninitialized or differs from the Launcher liquidity. No principal or fee amount is inferred.");let He=Q(d,L,x,z,A,I),xe=Q(s,Y,j,z,A,I);return{sqrtPriceX96:ce,tick:z,fee0:J(v,He,Ie),fee1:J(v,xe,Se)}}),y("poolConfig",async()=>{let t=N(await B(o,T,U("rootV1"),"poolConfig",[p],r.number));if(b(t.liquidityOwner)!==e.launcher||![l.currency0,l.currency1].includes(b(t.subject))||![l.currency0,l.currency1].includes(b(t.quote))||t.subject===t.quote)throw new i("Hookr pool configuration differs from this family position.");let k=b(t.rules),S=E(k);return await K(o,r.number,[k],w),{pc:t,core:k,role:S}})]);if(c.tokens=f,q&&(c.inRange=q.tick>=A&&q.tick<I,f)){let t=le({liquidity:v,tickLower:A,tickUpper:I,sqrtPriceX96:q.sqrtPriceX96});c.principal=[{token:f[0],amount:t.amount0.toString()},{token:f[1],amount:t.amount1.toString()}],c.uncollectedLpFees=[{token:f[0],amount:q.fee0.toString()},{token:f[1],amount:q.fee1.toString()}]}if(F){let t=(s,L=[])=>B(o,F.core,U("rulesV1"),s,L,r.number),[k,S,h,d]=await Promise.all([y("gateStatus",async()=>{let s=b(F.pc.advisory);return s!==ke&&await K(o,r.number,[s],w),fe(o,r.number,p,e.launcher,s)}),y("locks",async()=>be(o,{position:e,block:r,poolId:p,core:F.core,role:F.role})),y("claimableCoreCredits",async()=>{if(!f)throw new i("Read token metadata before displaying core credits.");let s=await t("poolAccruedCurrencies",[p]);if(!Array.isArray(s)||s.length>32||s.some(x=>x!==l.currency0&&x!==l.currency1))throw new i("Core accrual includes unmeasured currencies; read the core directly before collecting.");let[L,Y]=await Promise.all([Promise.all([l.currency0,l.currency1].map(x=>t("poolAccrued",[p,x]))),Promise.all([l.currency0,l.currency1].map(x=>B(o,F.core,U(F.role),"claimable",[x,n],r.number)))]);return{core:F.core,familyOwnerAccrual:L.map((x,j)=>({token:f[j],amount:g(x).toString()})),walletCredits:Y.map((x,j)=>({token:f[j],amount:g(x).toString()})),walletCreditsScope:"Core-wide wallet credits, not attributed to this position. Do not add them to LP fees."}}),y("poolPendingRecapture",async()=>{if(!f)throw new i("Read token metadata before displaying pending recapture.");let s=M(await t("pendingDonation",[p]),5).map(L=>g(L));return{due:[{token:f[0],amount:s[0].toString()},{token:f[1],amount:s[1].toString()}],fresh:[{token:f[0],amount:s[2].toString()},{token:f[1],amount:s[3].toString()}],freshChildBlock:s[4].toString(),scope:"pool",allocatedToPosition:!1}})]);c.gateStatus=k,c.locks=S,c.claimableCoreCredits=h,c.poolPendingRecapture=d}return u()}function Je(o){return[{name:"hookr_lp_position",inputSchema:$({position:qe,...de},["position"]),execute:async(n,e)=>{oe(n,["position","blockNumber"],["position"]);let a=Ne(n.position);if(o.network==="testnet")throw new i("Hookr LP reads are configured only on mainnet, chain 4663.");try{return await Te(o.clientFor(4663),e,a,pe(n))}catch(r){throw r instanceof i?r:new i("Hookr position block is unavailable. Retry the complete named-block read; no zero position or fee is implied.")}}}]}var he=o=>U(o.launcher===we(G.launcherV1)?"launcherV1":"launcher");function ze(o){let n=Ke(Oe([{type:"bytes32"},{type:"bytes32"}],[o,"0x3c0d3d8cba92527b3a48aa783c8734a4e170057eb16401c9df8a7c8a6588b900"]));return ae(BigInt(n)+5n,{size:32})}async function Me(o,n){try{let e="0x0000000000000000000000000000000000000a11",a=await o.request({method:"eth_call",params:[{to:e,data:"0x"},ae(n.number),{[e]:{code:"0x4360005260206000f3"}}]});return BigInt(V(a))}catch{throw new i("Hookr parent-block clock is unavailable. Retry with an RPC supporting named-block eth_call state overrides; child-chain height cannot establish lock expiry.")}}async function io(o,n,e){let a=await X(o);await K(o,a.number,[e.launcher,T,O]);let r=(d,s=[])=>B(o,e.launcher,he(e),d,s,a.number),[H,w,P,y]=await Promise.all([r("familyOwner",[e.familyId]),r("memberCount",[e.familyId]),r("position",[e.familyId,Number(e.member)]),r("poolManager")]),c=b(H);if(c===je||c!==n)throw new i("Only the current Hookr family owner can add, collect or remove this position. Use its signing wallet.");if(y!==O||g(w,8)<1n||g(w,8)>8n||BigInt(e.member)>=g(w,8))throw new i("Hookr family member or PoolManager differs from the reviewed deployment.");let u=N(P),m=ie(u.key),R=g(u.liquidity,128);if(typeof u.tickLower!="number"||typeof u.tickUpper!="number")throw new i("Hookr family range is unavailable.");let l=u.tickLower,p=u.tickUpper;W(l,p,m.tickSpacing);let A=D(m);if(await r("poolFamily",[A])!==e.familyId)throw new i("Hookr pool does not belong to this Launcher family.");let I=N(await B(o,T,U("rootV1"),"poolConfig",[A],a.number)),v=b(I.rules),f=E(v);if(b(I.liquidityOwner)!==e.launcher||![m.currency0,m.currency1].includes(b(I.subject))||![m.currency0,m.currency1].includes(b(I.quote))||I.subject===I.quote)throw new i("Hookr pool configuration differs from this family key.");await K(o,a.number,[v]);let[q,F]=await Promise.all([Promise.all([m.currency0,m.currency1].map(d=>_(o,d,a.number))),B(o,O,Ve(["function extsload(bytes32[] slots) view returns (bytes32[])"]),"extsload",[re(A,e.launcher,e.familyId,Number(e.member),l,p)],a.number)]),t=M(F,10).map(d=>BigInt(V(d))),k=t[0]&(1n<<160n)-1n,S=Number(BigInt.asIntN(24,t[0]>>160n));if(!k||S<-887272||S>887272||t[7]!==R)throw new i("Hookr PoolManager state differs from the family position. Retry the full read.");let h=[0,1].map(d=>J(R,Q(t[1+d],t[3+d],t[5+d],S,l,p),t[8+d]));return{position:e,block:a,owner:c,key:m,poolId:A,liquidity:R,tickLower:l,tickUpper:p,sqrtPriceX96:k,fees:h,tokens:q,pc:I,core:v,role:f}}async function be(o,n){let{position:e,block:a,poolId:r,core:H,role:w}=n,[P,y,c,u]=await Promise.all([B(o,e.launcher,he(e),"principalLockedUntil",[e.familyId],a.number),B(o,H,U(w),"removalLockedUntil",[r],a.number),o.getStorageAt({address:T,slot:ze(r),blockNumber:a.number}),Me(o,a)]),m=BigInt(V(c));if(we(ae(m&(1n<<160n)-1n,{size:20}))!==e.launcher)throw new i("Hookr frozen Root lock storage does not match the family owner contract.");let R=m>>160n&(1n<<40n)-1n,l=g(P),p=g(y);return{clock:"parent-block",parentBlock:u.toString(),familyUntilParentBlock:l.toString(),poolRulesUntilParentBlock:p.toString(),rootUntilParentBlock:R.toString(),currentlyLocked:u<l||u<p||u<R,feesCollectableDuringPrincipalLocks:!0}}export{he as a,ze as b,Me as c,io as d,be as e,qe as f,Ne as g,re as h,Q as i,J as j,ie as k,Te as l,Je as m};
|
|
1
|
+
import{A as le,s as D,x as W}from"./GEIFITAQ.js";import{d as fe}from"./74Y2KDNR.js";import{a as me,b as ee,c as de,e as oe,f as ye,g as pe,h as V,i as b,j as g,l as M,m as N,o as U,p as B,q as T,s as O,u as E,v as _}from"./JVLLVNF2.js";import{b as G,g as K,h as X,i as se,j as ue}from"./MQK6OP7S.js";import{c as Z}from"./NWNYJ26T.js";import{a as i}from"./XSD5NL7J.js";import{encodeAbiParameters as Oe,getAddress as we,keccak256 as Ke,parseAbi as Ve,toHex as ae,zeroAddress as je}from"viem";import{encodeAbiParameters as ge,encodePacked as Ce,getAddress as Ae,keccak256 as te,parseAbi as Fe,toHex as Le,zeroAddress as ke}from"viem";var Re=1n<<256n,ve=1n<<128n,Ue=Fe(["function extsload(bytes32[] slots) view returns (bytes32[])"]),$=(o,n)=>({type:"object",additionalProperties:!1,properties:o,required:n}),qe={oneOf:[$({kind:{const:"family"},launcher:Z,familyId:ee,member:{type:"string",enum:["0","1","2","3","4","5","6","7"]}},["kind","launcher","familyId","member"]),$({kind:{const:"nft"},tokenId:me},["kind","tokenId"]),$({kind:{const:"agent-account"},account:Z,positionId:ee},["kind","account","positionId"])]};function Ne(o){let n=N(o);if(n.kind!=="family")throw new i("This step supports Launcher family positions only. NFT and agent-account position reads are reserved for a later integration.");oe(n,["kind","launcher","familyId","member"],["kind","launcher","familyId","member"]);let e=ye(n.member,8);if(e>7n)throw new i("Hookr family member must be a decimal string from 0 to 7.");return{kind:"family",launcher:ue(n.launcher),familyId:V(n.familyId),member:e.toString()}}var C=o=>Le(BigInt.asUintN(256,o),{size:32}),ne=(o,n)=>te(ge([{type:"bytes32"},{type:"bytes32"}],[o,n]));function re(o,n,e,a,r,H){let w=ne(o,C(6n)),P=m=>ne(C(BigInt(m)),C(BigInt(w)+4n)),y=te(ge([{type:"bytes32"},{type:"uint8"}],[e,a])),c=te(Ce(["address","int24","int24","bytes32"],[n,r,H,y])),u=ne(c,C(BigInt(w)+6n));return[w,C(BigInt(w)+1n),C(BigInt(w)+2n),C(BigInt(P(r))+1n),C(BigInt(P(r))+2n),C(BigInt(P(H))+1n),C(BigInt(P(H))+2n),u,C(BigInt(u)+1n),C(BigInt(u)+2n)]}function Q(o,n,e,a,r,H){return BigInt.asUintN(256,a<r?n-e:a>=H?e-n:o-n-e)}function J(o,n,e){if(o<0n||o>=1n<<128n||[n,e].some(a=>a<0n||a>=Re))throw new i("Hookr fee inputs are outside the verified v4 layout.");return o*BigInt.asUintN(256,n-e)/ve}function ie(o){let n=N(o),e={currency0:b(n.currency0),currency1:b(n.currency1),fee:Number(g(n.fee,24)),tickSpacing:Number(g(n.tickSpacing,24)),hooks:b(n.hooks)};if(BigInt(e.currency0)>=BigInt(e.currency1)||e.fee!==8388608||e.hooks!==T||e.tickSpacing<1||e.tickSpacing>32767)throw new i("Hookr family PoolKey is not a supported Root dynamic-fee pool.");return e}async function Te(o,n,e,a){let r=await X(o,a),H={},w=new Set,P=(t,k=[])=>B(o,e.launcher,U(e.launcher===Ae(G.launcherV1)?"launcherV1":"launcher"),t,k,r.number),y=async(t,k)=>{try{return await k()}catch(S){return H[t]=S instanceof i?S.message:`Hookr ${t} read failed at block ${r.number}. Retry the named-block read; no zero or empty result is implied.`,null}},c={chainId:4663,blockNumber:r.number.toString(),blockHash:r.hash,position:e,owner:null,ownedByWallet:null,poolId:null,poolKey:null,range:null,liquidity:null,tokens:null,principal:null,uncollectedLpFees:null,collectedLpFees:null,claimableCoreCredits:null,poolPendingRecapture:null,inRange:null,gateStatus:null,locks:null},u=async()=>(await se(o,r),{...c,readStatus:{status:Object.keys(H).length?"partial":"complete",reasons:H},warnings:["collectedLpFees is null: no complete collection-history reconstruction is available in this step.","LP fees can include donations already released into v4 fee growth. Pending recapture is pool-level, unallocated and excluded from LP fees.","Principal is current withdrawable token inventory before fees, gas or price changes; it is not the original deposit value."]});if(await y("pins",async()=>(await K(o,r.number,[e.launcher,T,O],w),!0))===null)return u();let m=await y("owner",async()=>{let t=b(await P("familyOwner",[e.familyId]));if(t===ke)throw new i("Hookr family does not exist at this block. Check its Launcher and family ID.");return t});if(m===null)return u();c.owner=m,c.ownedByWallet=m===n;let R=await y("position",async()=>{let[t,k,S]=await Promise.all([P("memberCount",[e.familyId]),P("position",[e.familyId,Number(e.member)]),P("poolManager")]);if(S!==O||g(t,8)>8n||BigInt(e.member)>=g(t,8))throw new i("Hookr family member or PoolManager is invalid.");let h=N(k),d=ie(h.key);if(typeof h.tickLower!="number"||typeof h.tickUpper!="number")throw new i("Hookr position range is incomplete.");W(h.tickLower,h.tickUpper,d.tickSpacing);let s=g(h.liquidity,128),L=D(d);if(await P("poolFamily",[L])!==e.familyId)throw new i("Hookr pool does not belong to this family.");return{key:d,id:L,tickLower:h.tickLower,tickUpper:h.tickUpper,liquidity:s}});if(R===null)return u();let{key:l,id:p,tickLower:A,tickUpper:I,liquidity:v}=R;c.poolKey=l,c.poolId=p,c.range={tickLower:A,tickUpper:I},c.liquidity=v.toString();let[f,q,F]=await Promise.all([y("tokens",()=>Promise.all([_(o,l.currency0,r.number),_(o,l.currency1,r.number)])),y("feeGrowth",async()=>{let t=re(p,e.launcher,e.familyId,Number(e.member),A,I),k=await B(o,O,Ue,"extsload",[t],r.number),S=M(k,10).map(Be=>BigInt(V(Be))),[h,d,s,L,Y,x,j,Pe,Ie,Se]=S,ce=h&(1n<<160n)-1n,z=Number(BigInt.asIntN(24,h>>160n));if(ce===0n||z<-887272||z>887272||Pe!==v)throw new i("Hookr PoolManager position is uninitialized or differs from the Launcher liquidity. No principal or fee amount is inferred.");let He=Q(d,L,x,z,A,I),xe=Q(s,Y,j,z,A,I);return{sqrtPriceX96:ce,tick:z,fee0:J(v,He,Ie),fee1:J(v,xe,Se)}}),y("poolConfig",async()=>{let t=N(await B(o,T,U("rootV1"),"poolConfig",[p],r.number));if(b(t.liquidityOwner)!==e.launcher||![l.currency0,l.currency1].includes(b(t.subject))||![l.currency0,l.currency1].includes(b(t.quote))||t.subject===t.quote)throw new i("Hookr pool configuration differs from this family position.");let k=b(t.rules),S=E(k);return await K(o,r.number,[k],w),{pc:t,core:k,role:S}})]);if(c.tokens=f,q&&(c.inRange=q.tick>=A&&q.tick<I,f)){let t=le({liquidity:v,tickLower:A,tickUpper:I,sqrtPriceX96:q.sqrtPriceX96});c.principal=[{token:f[0],amount:t.amount0.toString()},{token:f[1],amount:t.amount1.toString()}],c.uncollectedLpFees=[{token:f[0],amount:q.fee0.toString()},{token:f[1],amount:q.fee1.toString()}]}if(F){let t=(s,L=[])=>B(o,F.core,U("rulesV1"),s,L,r.number),[k,S,h,d]=await Promise.all([y("gateStatus",async()=>{let s=b(F.pc.advisory);return s!==ke&&await K(o,r.number,[s],w),fe(o,r.number,p,e.launcher,s)}),y("locks",async()=>be(o,{position:e,block:r,poolId:p,core:F.core,role:F.role})),y("claimableCoreCredits",async()=>{if(!f)throw new i("Read token metadata before displaying core credits.");let s=await t("poolAccruedCurrencies",[p]);if(!Array.isArray(s)||s.length>32||s.some(x=>x!==l.currency0&&x!==l.currency1))throw new i("Core accrual includes unmeasured currencies; read the core directly before collecting.");let[L,Y]=await Promise.all([Promise.all([l.currency0,l.currency1].map(x=>t("poolAccrued",[p,x]))),Promise.all([l.currency0,l.currency1].map(x=>B(o,F.core,U(F.role),"claimable",[x,n],r.number)))]);return{core:F.core,familyOwnerAccrual:L.map((x,j)=>({token:f[j],amount:g(x).toString()})),walletCredits:Y.map((x,j)=>({token:f[j],amount:g(x).toString()})),walletCreditsScope:"Core-wide wallet credits, not attributed to this position. Do not add them to LP fees."}}),y("poolPendingRecapture",async()=>{if(!f)throw new i("Read token metadata before displaying pending recapture.");let s=M(await t("pendingDonation",[p]),5).map(L=>g(L));return{due:[{token:f[0],amount:s[0].toString()},{token:f[1],amount:s[1].toString()}],fresh:[{token:f[0],amount:s[2].toString()},{token:f[1],amount:s[3].toString()}],freshChildBlock:s[4].toString(),scope:"pool",allocatedToPosition:!1}})]);c.gateStatus=k,c.locks=S,c.claimableCoreCredits=h,c.poolPendingRecapture=d}return u()}function Je(o){return[{name:"hookr_lp_position",inputSchema:$({position:qe,...de},["position"]),execute:async(n,e)=>{oe(n,["position","blockNumber"],["position"]);let a=Ne(n.position);if(o.network==="testnet")throw new i("Hookr LP reads are configured only on mainnet, chain 4663.");try{return await Te(o.clientFor(4663),e,a,pe(n))}catch(r){throw r instanceof i?r:new i("Hookr position block is unavailable. Retry the complete named-block read; no zero position or fee is implied.")}}}]}var he=o=>U(o.launcher===we(G.launcherV1)?"launcherV1":"launcher");function ze(o){let n=Ke(Oe([{type:"bytes32"},{type:"bytes32"}],[o,"0x3c0d3d8cba92527b3a48aa783c8734a4e170057eb16401c9df8a7c8a6588b900"]));return ae(BigInt(n)+5n,{size:32})}async function Me(o,n){try{let e="0x0000000000000000000000000000000000000a11",a=await o.request({method:"eth_call",params:[{to:e,data:"0x"},ae(n.number),{[e]:{code:"0x4360005260206000f3"}}]});return BigInt(V(a))}catch{throw new i("Hookr parent-block clock is unavailable. Retry with an RPC supporting named-block eth_call state overrides; child-chain height cannot establish lock expiry.")}}async function io(o,n,e){let a=await X(o);await K(o,a.number,[e.launcher,T,O]);let r=(d,s=[])=>B(o,e.launcher,he(e),d,s,a.number),[H,w,P,y]=await Promise.all([r("familyOwner",[e.familyId]),r("memberCount",[e.familyId]),r("position",[e.familyId,Number(e.member)]),r("poolManager")]),c=b(H);if(c===je||c!==n)throw new i("Only the current Hookr family owner can add, collect or remove this position. Use its signing wallet.");if(y!==O||g(w,8)<1n||g(w,8)>8n||BigInt(e.member)>=g(w,8))throw new i("Hookr family member or PoolManager differs from the reviewed deployment.");let u=N(P),m=ie(u.key),R=g(u.liquidity,128);if(typeof u.tickLower!="number"||typeof u.tickUpper!="number")throw new i("Hookr family range is unavailable.");let l=u.tickLower,p=u.tickUpper;W(l,p,m.tickSpacing);let A=D(m);if(await r("poolFamily",[A])!==e.familyId)throw new i("Hookr pool does not belong to this Launcher family.");let I=N(await B(o,T,U("rootV1"),"poolConfig",[A],a.number)),v=b(I.rules),f=E(v);if(b(I.liquidityOwner)!==e.launcher||![m.currency0,m.currency1].includes(b(I.subject))||![m.currency0,m.currency1].includes(b(I.quote))||I.subject===I.quote)throw new i("Hookr pool configuration differs from this family key.");await K(o,a.number,[v]);let[q,F]=await Promise.all([Promise.all([m.currency0,m.currency1].map(d=>_(o,d,a.number))),B(o,O,Ve(["function extsload(bytes32[] slots) view returns (bytes32[])"]),"extsload",[re(A,e.launcher,e.familyId,Number(e.member),l,p)],a.number)]),t=M(F,10).map(d=>BigInt(V(d))),k=t[0]&(1n<<160n)-1n,S=Number(BigInt.asIntN(24,t[0]>>160n));if(!k||S<-887272||S>887272||t[7]!==R)throw new i("Hookr PoolManager state differs from the family position. Retry the full read.");let h=[0,1].map(d=>J(R,Q(t[1+d],t[3+d],t[5+d],S,l,p),t[8+d]));return{position:e,block:a,owner:c,key:m,poolId:A,liquidity:R,tickLower:l,tickUpper:p,sqrtPriceX96:k,fees:h,tokens:q,pc:I,core:v,role:f}}async function be(o,n){let{position:e,block:a,poolId:r,core:H,role:w}=n,[P,y,c,u]=await Promise.all([B(o,e.launcher,he(e),"principalLockedUntil",[e.familyId],a.number),B(o,H,U(w),"removalLockedUntil",[r],a.number),o.getStorageAt({address:T,slot:ze(r),blockNumber:a.number}),Me(o,a)]),m=BigInt(V(c));if(we(ae(m&(1n<<160n)-1n,{size:20}))!==e.launcher)throw new i("Hookr frozen Root lock storage does not match the family owner contract.");let R=m>>160n&(1n<<40n)-1n,l=g(P),p=g(y);return{clock:"parent-block",parentBlock:u.toString(),familyUntilParentBlock:l.toString(),poolRulesUntilParentBlock:p.toString(),rootUntilParentBlock:R.toString(),currentlyLocked:u<l||u<p||u<R,feesCollectableDuringPrincipalLocks:!0}}export{he as a,ze as b,Me as c,io as d,be as e,qe as f,Ne as g,re as h,Q as i,J as j,ie as k,Te as l,Je as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as S}from"./WWNAGOCD.js";import{c as U}from"./
|
|
1
|
+
import{a as S}from"./WWNAGOCD.js";import{c as U}from"./74Y2KDNR.js";import{b as R,c as I,d as j,e as C,g as D,h as V,j as t,k as w,l as E,m as B,o as n,p as o,q as d,r as p,s as y,v as H}from"./JVLLVNF2.js";import{b as a,f as F,g as L,h as O,i as q}from"./MQK6OP7S.js";import{a as s}from"./XSD5NL7J.js";import{getAddress as i}from"viem";async function re(r,m,x,u=[]){let e=await O(r,x);await L(r,e.number,[a.launcherV1,d,a.rulesV1,a.agentGateV1]);let l=i(a.launcherV1),[h,_,z,N,Q,K,G,W,$,J,X,A,b]=await Promise.all([U(r,e.number,m,u),o(r,l,j,"launchFee",[],e.number),o(r,p,n("registry"),"rootOpenFor",[d,m],e.number),o(r,p,n("registry"),"newMarketsPaused",[],e.number),o(r,p,n("registry"),"isLauncher",[l],e.number),o(r,d,n("rootV1"),"poolManager",[],e.number),o(r,l,n("launcherV1"),"poolManager",[],e.number),o(r,l,n("launcherV1"),"registry",[],e.number),o(r,i(a.rulesV1),n("rulesV1"),"trustedRoot",[],e.number),o(r,i(a.rulesV1),n("rulesV1"),"poolManager",[],e.number),o(r,p,n("registry"),"admission",[d,i(a.rulesV1)],e.number),o(r,i(a.rulesV1),n("rulesV1"),"configSchemaHash",[],e.number),o(r,p,n("registry"),"quoteAssets",[],e.number)]);if(K!==y||G!==y||W!==p||$!==d||J!==y)throw new s("Hookr launch dependency wiring differs from the reviewed deployment.");V(A);let c=B(X),g=B(c.caps);if(c.implementation!==i(a.rulesV1)||t(c.kind,8)!==0n||c.codeHash!==F(a.rulesV1).codeHash||c.schemaHash!==A||t(c.gasLimit,32)===0n||t(g.maxLpFeePips,24)>600000n||t(g.maxQuoteTakePips,24)>=1000000n||t(g.maxSubjectTakeBps,16)>1000n)throw new s("Hookr core admission, schema or caps differ from the supported launch profile.");if(!Array.isArray(b)||b.length>32)throw new s("Hookr qualified quote list is incomplete or exceeds the bounded read.");let T=[];for(let f=0;f<b.length;f+=2)T.push(...await Promise.all(b.slice(f,f+2).map(ee=>H(r,i(String(ee)),e.number))));let Y=await H(r,i("0x0000000000000000000000000000000000000000"),e.number),k=E(_,5),Z={token:Y,amount:t(k[0]).toString(),currency:"ETH",decimals:18,treasury:i(String(k[1])),pendingAmount:t(k[2]).toString(),pendingTreasury:i(String(k[3])),readyAt:t(k[4]).toString()},M=w(z),P=w(N),v=w(Q);return await q(r,e),{chainId:4663,blockNumber:e.number.toString(),blockHash:e.hash,timestamp:e.timestamp.toString(),version:"hookr-launcher-v1",launcher:l,root:d,core:i(a.rulesV1),poolManager:y,permissionMask:"0x2acc",launchFee:Z,qualifiedQuotes:T,coreAdmission:{schemaHash:A,gasLimit:t(c.gasLimit,32).toString(),caps:{maxLpFeePips:t(g.maxLpFeePips,24).toString(),maxQuoteTakePips:t(g.maxQuoteTakePips,24).toString(),maxSubjectTakeBps:t(g.maxSubjectTakeBps,16).toString()}},gate:h,rootOpenForWallet:M,newMarketsPaused:P,launcherAdmitted:v,launchAvailable:M&&!P&&v&&h.healthyIdentityOnly&&h.walletAgent,scoreLaunchAvailable:M&&!P&&v&&h.healthyForScores&&h.walletAgent,supportedSettings:{route:"launchAdvised",members:"1",tokenKinds:["new"],reservedTokenKinds:["existing"],tickSpacing:String(S.tickSpacing),baseLpFeePips:String(S.baseLpFeePips),deadlineSecondsMax:S.deadlineSeconds.toString(),guardEndBlock:"0",burnBps:"0",royaltyBps:"0",integrator:null,nameMaxUtf8Bytes:"48",symbolMaxUtf8Bytes:"12",supplyMaxBaseUnits:((1n<<108n)-1n).toString(),liquidityMax:((1n<<127n)-1n).toString(),fee:"8388608",tickSpacingMin:"1",tickSpacingMax:"32767",tickMin:"-887272",tickMax:"887272",requiresTickAlignment:!0,gateRequired:!0,gatePhases:"1",gateFailOpen:!1,arbitraryAdvisories:!1,devBuy:!1,locks:!1,ownedRoot:!1,lpRewardsBpsMax:"1000",lpRewardsPlusBurnBpsMax:"1000",totalLpFeePipsMax:"600000",protocolShareBpsMin:"2000",protocolShareBpsMax:"5000",existingTokenFunding:"requires a separately qualified token route"},readStatus:"complete",warnings:["Read-only admission snapshot. hookr_launch supports one new-token agents-only pool with the fixed profile; add/collect/remove require separate tools.","Oak identity linking alone does not establish on-chain Hookr gate eligibility.",h.reviewerSetsNotice]}}function le(r){return[{name:"hookr_launch_options",inputSchema:{type:"object",additionalProperties:!1,properties:{...I,reviewerSetIds:{type:"array",maxItems:8,uniqueItems:!0,items:R,description:"Existing registered reviewer set IDs to inspect; no alias or arbitrary reviewer address."}}},execute:async(m,x)=>{if(C(m,["blockNumber","reviewerSetIds"]),r.network==="testnet")throw new s("Hookr launch reads are configured only on mainnet, chain 4663.");let u=m.reviewerSetIds??[];if(!Array.isArray(u)||u.length>8||new Set(u).size!==u.length)throw new s("Provide at most eight distinct reviewer set IDs.");let e=u.map(V);if(new Set(e).size!==e.length)throw new s("Provide distinct reviewer set IDs.");try{return await re(r.clientFor(4663),x,D(m),e)}catch(l){throw l instanceof s?l:new s("Hookr launch settings are unavailable at the named block. Retry the complete read; no zero fee or healthy gate is implied.")}}}]}export{re as a,le as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as A}from"./IX3GZMTM.js";import{a as g}from"./5CAAFU7R.js";import{a as d}from"./XSD5NL7J.js";import{concat as b,encodeAbiParameters as L,getAddress as G,isAddress as C,keccak256 as h,parseAbiParameters as I,toHex as v}from"viem";var B=h(v("OakGrandfather/v1")),w="oak-grandfather/v1",D=(1n<<256n)-1n,H="0x0000000000000000000000000000000000000000000000000000000000000000";function p(e,n){if(typeof e!="string"||!C(e,{strict:!1}))throw new d(`Invalid ${n} address.`);return G(e)}function x(e,n){if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e))throw new d(`${n} must be a 32-byte hex string.`);return e.toLowerCase()}function E(e){let n=typeof e=="bigint"?e:A(e);if(n<0n||n>D)throw new d("Count exceeds uint256 bounds.");return n}function j(e,n,o){let i=typeof e=="object"?e.wallet:e,t=typeof e=="object"?e.count:n,c=typeof e=="object"?e.source:o;if(t===void 0||c===void 0)throw new d("Grandfather leaf requires wallet, count and source.");let u=h(L(I("bytes32, address, uint256, address"),[B,p(i,"wallet"),E(t),p(c,"source")]));return h(u)}function R(e,n){let o=x(e,"first node"),i=x(n,"second node");return BigInt(o)<=BigInt(i)?h(b([o,i])):h(b([i,o]))}function _(e,n,o){if(!Array.isArray(o))throw new d("Grandfather proof must be an array.");let i=x(e,"root"),t=x(n,"leaf");for(let c=0;c<o.length;c++){if(!Object.prototype.hasOwnProperty.call(o,c))throw new d("Grandfather proof must not be a sparse array.");t=R(t,o[c])}return t===i}function S(e){if(!Array.isArray(e))throw new d("Grandfather entries must be an array.");let n=new Set,o=[];for(let r=0;r<e.length;r++){if(!Object.prototype.hasOwnProperty.call(e,r)||!e[r])throw new d(`Grandfather entries must not be sparse (missing index ${r}).`);let s=e[r],a=p(s.wallet,"wallet").toLowerCase(),f=p(s.source,"source").toLowerCase(),l=E(s.count).toString();if(n.has(a))throw new d(`Duplicate wallet in grandfather entries: ${a}`);n.add(a),o.push({wallet:a,count:l,source:f})}if(o.sort((r,s)=>BigInt(r.wallet)<BigInt(s.wallet)?-1:BigInt(r.wallet)>BigInt(s.wallet)?1:0),o.length===0){let r=g({entries:[],root:H,schema:w});return{schema:w,root:H,entries:[],proofs:{},canonicalJson:r}}let i=o.map(r=>j(r)),t=[i];for(;t[t.length-1].length>1;){let r=t[t.length-1],s=[];for(let a=0;a<r.length;a+=2){let f=r[a],l=r[a+1];s.push(l!==void 0?R(f,l):f)}t.push(s)}let c=t[t.length-1][0],u={},P=o.map((r,s)=>{let a=[],f=s;for(let l=0;l<t.length-1;l++){let y=t[l],m=f^1;m<y.length&&a.push(y[m]),f=Math.floor(f/2)}return u[r.wallet]=a,u[G(r.wallet)]=a,{...r,leaf:i[s],proof:a}}),T=g({entries:o.map(({count:r,source:s,wallet:a})=>({count:r,source:s,wallet:a})),root:c,schema:w});return{schema:w,root:c,entries:P,proofs:u,canonicalJson:T}}var M=S;function N(e,n){let o=p(n,"wallet").toLowerCase(),i=Array.isArray(e)?S(e):e,t=i.entries.find(u=>u.wallet.toLowerCase()===o);if(!t)throw new d(`Wallet ${n} is not in the grandfather list.`);let c=[...t.proof];return Object.defineProperties(c,{proof:{value:[...t.proof],enumerable:!1},leaf:{value:t.leaf,enumerable:!1},root:{value:i.root,enumerable:!1},entry:{value:{wallet:t.wallet,count:t.count,source:t.source},enumerable:!1},count:{value:t.count,enumerable:!1},source:{value:t.source,enumerable:!1}}),c}export{B as a,w as b,j as c,R as d,_ as e,S as f,M as g,N as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as u,h as l,i as y}from"./NWNYJ26T.js";import{a as p}from"./XSD5NL7J.js";import{a as m}from"./JXOEJPJ4.js";import{parseUnits as b}from"viem";var h={"User-Agent":"oak-core/borro",Accept:"application/json"};async function g(e,o,a){let c=AbortSignal.timeout(1e4),n=await e(`https://borro.markets/${o}.json`,{method:"GET",headers:h,redirect:"error",signal:a?AbortSignal.any([a,c]):c});if(!n.ok||n.redirected||!n.body)throw new p("Borro's page could not be read right now.");let t=n.body.getReader(),r=new TextDecoder,s=0,d="";try{for(;;){let{done:i,value:f}=await t.read();if(i)break;if(s+=f.byteLength,s>2e6)throw new p("Borro's page exceeds the read limit.");d+=r.decode(f,{stream:!0})}return JSON.parse(d+r.decode())}finally{await t.cancel().catch(()=>{}),t.releaseLock()}}var A=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1?e:void 0;function k(e,o=Date.now()/1e3){let a=new Map;if(!u(e))return a;let c=typeof e.read_at=="string"?Date.parse(e.read_at)/1e3:NaN;if(!Number.isFinite(c)||c>o+30||o-c>300)return a;let n=(t,r)=>{if(!u(r)||!u(r.lend)||a.has(t))return;let s=A(r.lend.apr),d=r.lend.ready_to_withdraw,i;try{i=y(t==="USDG"?r.vault:u(r.contracts)?r.contracts.vault:void 0,"Unreadable rate vault.")}catch{}a.set(t,{...i?{vault:i}:{},...s===void 0?{}:{apr:s},...t==="USDG"&&typeof d=="number"&&Number.isFinite(d)&&d>=0&&d<=Number.MAX_SAFE_INTEGER?{ready:d}:{}})};if(n("USDG",e.usdg),Array.isArray(e.stocks)&&e.stocks.length<=1e3){let t=e.stocks.filter(u),r=t.map(s=>typeof s.symbol=="string"?s.symbol.toUpperCase():"");t.forEach((s,d)=>{let i=r[d];/^[A-Z0-9.$_-]{1,32}$/.test(i)&&r.indexOf(i)===r.lastIndexOf(i)&&n(i,s)})}return a}async function _(e,o,a=Date.now()/1e3){try{return k(await g(e,"markets",o),a)}catch{return new Map}}function S(e,o,a){let c=e.get(o.symbol.toUpperCase()),n=l(c?.vault,a)?c:void 0,t;if(n?.ready!==void 0)try{t={token:o,amount:b(n.ready.toFixed(o.decimals),o.decimals).toString()}}catch{}return{rate:n?.apr===void 0?"unavailable":"available",...n?.apr===void 0?{}:{apr:n.apr,source:m("Borro markets.json; display data only")},...t?{readyToWithdraw:t}:{}}}export{h as a,g as b,k as c,_ as d,S as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as w,b as R}from"./
|
|
1
|
+
import{a as w,b as R}from"./OTXSKFUD.js";import{a,e as P}from"./XSD5NL7J.js";function q(t){return t===404||t===410?`The service returned HTTP ${t}: it has no record of that request, so trying again will not help.`:`The service returned HTTP ${t}. Please try again.`}var y=class extends a{constructor(n){super(q(n.status));this.response=n}response};function h(){return new a("The request was cancelled.")}async function v(t,s){if(s.aborted)throw h();await new Promise((n,c)=>{let o=setTimeout(()=>{s.removeEventListener("abort",m),n()},t),m=()=>{clearTimeout(o),s.removeEventListener("abort",m),c(h())};s.addEventListener("abort",m,{once:!0})})}function _(t,s){if(t===null)return s;if(/^\d+(\.\d+)?$/.test(t))return Number(t)*1e3;let n=Date.parse(t);return Number.isFinite(n)?Math.max(0,n-Date.now()):s}function A(t={}){let s=t.fetch??globalThis.fetch,n=t.timeoutMs??1e4,c=t.retries??2,u=t.retryDelayMs??250,o=t.maxRetryDelayMs??3e4;if(!Number.isInteger(c)||c<0||c>10||!Number.isFinite(n)||n<=0||n>2147483647||!Number.isFinite(u)||u<0||!Number.isFinite(o)||o<0||o>2147483647)throw new a("Provide finite timeout and retry bounds, with 0 to 10 retries.");return async(m,k)=>{let r=new Request(m,{...k,redirect:"error"}),d=R(s,r.url),N=r.method==="GET"||r.method==="HEAD";for(let b=0;;b++){if(r.signal.aborted)throw h();if(d){let e=Date.now()+2e3,f=d.reserve();for(f>0&&await v(f,r.signal);;){if(r.signal.aborted)throw h();if(Date.now()>e)throw new w(d.label,1);let i=d.dispatchDelay();if(i===0)break;if(Date.now()+i>e)throw new w(d.label,i/1e3);await v(i,r.signal)}}if(r.signal.aborted)throw h();let p=new AbortController,x=()=>p.abort();r.signal.addEventListener("abort",x,{once:!0});let D=!1,O=setTimeout(()=>{D=!0,p.abort()},n),M;try{let e=await s(r.clone(),{signal:p.signal});if(e.redirected)throw await e.body?.cancel(),new a("The request failed. Please try again.");if(e.ok){let f=await e.text();if(r.method!=="HEAD"&&e.status!==204&&e.status!==205){let i=r.headers.get("accept")?.toLowerCase(),l=e.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase(),T=l?.startsWith("text/"),E=i?.split(",").some(g=>g.trim().startsWith("text/"));if(!E&&i?.split(",").some(g=>/(?:application\/json|\+json)(?:\s*;.*)?$/.test(g.trim()))||l==="application/json"||l?.endsWith("+json")||!T&&!E)try{JSON.parse(f)}catch{throw new a("The service returned malformed JSON.")}}return new Response(f||null,{status:e.status,statusText:e.statusText,headers:e.headers})}else{let f=e.status===429||e.status>=500,i=u*2**b*(.5+Math.random()),l=Math.max(i,_(e.headers.get("Retry-After"),i));if(e.status===429&&d?.backoff(l),!N||!f||b>=c||l>o){if(e.status===429)throw await e.body?.cancel(),new w(d?.label??"The service",Math.max(1,l/1e3));let T=await e.text();throw new y(new Response(T||null,{status:e.status,statusText:e.statusText,headers:e.headers}))}await e.body?.cancel(),M=l}}catch(e){throw r.signal.aborted?h():D?new a("The request timed out. Please try again."):e instanceof y?e:new a(P(e))}finally{clearTimeout(O),r.signal.removeEventListener("abort",x)}await v(M,r.signal)}}}async function S(t,s,n,c){let u=await t(s,n);if(!u.ok)throw new a(q(u.status));let o;try{o=await u.json()}catch{throw new a("The service returned malformed JSON.")}try{if(c(o))return o}catch{}throw new a("The service returned an unexpected response.")}export{y as a,A as b,S as c};
|