@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 +0,0 @@
|
|
|
1
|
-
import{b as pe,c as me}from"./5OKJEGBH.js";import{a as ue}from"./Z4SRGAVL.js";import{a as be}from"./PBQSJSZO.js";import{c as le}from"./MYFAKCQI.js";import{a as O}from"./5ZLOCQA4.js";import{c as Y,d as oe,g as I,i as fe,m as re,n as se}from"./5KUWLUPM.js";import{a as S,i as de,j as ie}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{decodeFunctionData as J,encodeFunctionData as T,erc20Abi as te,getAddress as he,keccak256 as Ce,parseAbi as P}from"viem";var q={chainId:4663,observedAt:"2026-10-31",block:"102927065",routeBlock:"102928782",sources:["https://rpc.mainnet.chain.robinhood.com","https://raw.githubusercontent.com/beefyfinance/cowcentrated-subgraph/main/abis/beefy/clm/ClmManager.json","https://raw.githubusercontent.com/beefyfinance/beefy-v2/main/src/features/data/apis/beefy/beefy-clm-pool.ts"],markets:{v3:{router:"0xCaf681a66D020601342297493863E78C959E5cb2",quoter:"0x33e885eD0Ec9bF04EcfB19341582aADCb4c8A9E7",factory:"0x1f7d7550B1b028f7571E69A784071F0205FD2EfA"},cl:{router:"0xC062b870E813fcA720f1e002c234369Ab3aB9415",quoter:"0x03983AB2C057a2eac211ff01738a1e49ff325B49",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3"}},vaults:[{id:"up33-cow-robinhood-cashcat-weth-vault",vault:"0x25012D654bF9107B6E0Af0248656fEf0b718dBd3",manager:"0x137731B8B2D7Cd24aB4A4A9061f2D7b4Fd1aBFEE",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x020bfC650A365f8BB26819deAAbF3E21291018b4","0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"],strategy:"0xd7F3bCDAfCFf0018953BB6944Db2683Ff2e42b07",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0xF5331Dc29A1FDe4b22d7F168661584B057228683",pool:"0x4E8649Be40aE67EBbcff99C291B92eE03015917b",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"},{id:"up33-cow-robinhood-usdg-net-vault",vault:"0x25B418FcFe8543c25AD9d78246839E5Cf3a3b50D",manager:"0x5A725556514222d0cc81501A9294a3135b7C41C4",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168","0xCA9c78Dd337A67F6e0077F65F5E9218719d30eDf"],strategy:"0x89207bED2935C64d6cb105E9C85E0E2ED99DD8f2",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0xF5331Dc29A1FDe4b22d7F168661584B057228683",pool:"0x99e70A5b06215e5D2F3BeC773b4f59c008fc1673",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168"},{id:"up33-cow-robinhood-weth-stonkbroker-vault",vault:"0x544c7Ef9265dc08d93B5394116E68aE7D9e60730",manager:"0x5794bB61E83397049c40D87BbF3d44AF583A27Ce",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73","0xe934e36A439C94017B64a3FecE66AF12099aBF50"],strategy:"0x54Bd0805f549708144C811c14DdEeC0714CA5e0c",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0xF5331Dc29A1FDe4b22d7F168661584B057228683",pool:"0xB11ba9a4d345434c25d625C076f23Ad14abC6B3c",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"},{id:"up33-cow-robinhood-weth-up-vault",vault:"0x56EA4b4AFAFbb87CFD8Fd8a0266a2F86561677b8",manager:"0x36759534741E28Eb052238738963D684bFe719E4",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73","0x57C0E45cB534413D1C20A4240955d6bB250BB4F1"],strategy:"0x8337c691C3afA52ccE418178e52ed472F034Cb8b",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0xF5331Dc29A1FDe4b22d7F168661584B057228683",pool:"0x23D641FeCcD207E8794c593e8240444A0674C4Ba",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"},{id:"up33-cow-robinhood-weth-frong-vault",vault:"0x75588e48f7b4Ed9365d78C6cD509f3C7B804Ca47",manager:"0x9818f01EDCcc3d8EB86B859931C3B877cf44A108",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73","0x6245e67affA44a23077f0Ea7f981a8DC743a0c47"],strategy:"0xdB739d906CD5101b65E089a284ec13a3ab21F603",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0xF5331Dc29A1FDe4b22d7F168661584B057228683",pool:"0x9334BbCBE77C0883d704f71Db35CCF636639334c",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"},{id:"up33-cow-robinhood-usdg-intc-vault",vault:"0x8353c496114CF66D10545fdc2B4e6dFBafd37e3b",manager:"0x599ac767099bB6f01712867BfA1Fc1Aa27DEFD37",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168","0xc72b96e0E48ecd4DC75E1e45396e26300BC39681"],strategy:"0xbaEE86C9D7dE9dc192f17dFA62833B601Dc64D23",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0xF5331Dc29A1FDe4b22d7F168661584B057228683",pool:"0x6290Be6e6913708866E6f17eaf3F4FCC7d3fdF67",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:60,bridge:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168"},{id:"up33-cow-robinhood-weth-tendies-vault",vault:"0x97DCDc29a3B3e2F556564279f7D09eE40eB74E45",manager:"0x9619bFB1f2D97E2B23F23310205e4c2089c1A45d",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73","0x45242320DBB855EeA8Fd36804C6487E10E97FCF9"],strategy:"0x9a02CaA8a2e63659f8A419a29a3B48baD86d3c7a",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0xF5331Dc29A1FDe4b22d7F168661584B057228683",pool:"0xD53a623c17A5853838FA140cE5706eA008565dA8",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"}],routes:[{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0x020bfC650A365f8BB26819deAAbF3E21291018b4",kind:"cl",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000c8020bfc650a365f8bb26819deaabf3e21291018b4",pools:["0x4E8649Be40aE67EBbcff99C291B92eE03015917b"]},{from:"0x020bfC650A365f8BB26819deAAbF3E21291018b4",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"cl",path:"0x020bfc650a365f8bb26819deaabf3e21291018b40000c80bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0x4E8649Be40aE67EBbcff99C291B92eE03015917b"]},{from:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",to:"0xCA9c78Dd337A67F6e0077F65F5E9218719d30eDf",kind:"cl",path:"0x5fc5360d0400a0fd4f2af552add042d716f1d1680000c8ca9c78dd337a67f6e0077f65f5e9218719d30edf",pools:["0x99e70A5b06215e5D2F3BeC773b4f59c008fc1673"]},{from:"0xCA9c78Dd337A67F6e0077F65F5E9218719d30eDf",to:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",kind:"cl",path:"0xca9c78dd337a67f6e0077f65f5e9218719d30edf0000c85fc5360d0400a0fd4f2af552add042d716f1d168",pools:["0x99e70A5b06215e5D2F3BeC773b4f59c008fc1673"]},{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0xe934e36A439C94017B64a3FecE66AF12099aBF50",kind:"cl",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000c8e934e36a439c94017b64a3fece66af12099abf50",pools:["0xB11ba9a4d345434c25d625C076f23Ad14abC6B3c"]},{from:"0xe934e36A439C94017B64a3FecE66AF12099aBF50",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"cl",path:"0xe934e36a439c94017b64a3fece66af12099abf500000c80bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0xB11ba9a4d345434c25d625C076f23Ad14abC6B3c"]},{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0x57C0E45cB534413D1C20A4240955d6bB250BB4F1",kind:"cl",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000c857c0e45cb534413d1c20a4240955d6bb250bb4f1",pools:["0x23D641FeCcD207E8794c593e8240444A0674C4Ba"]},{from:"0x57C0E45cB534413D1C20A4240955d6bB250BB4F1",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"cl",path:"0x57c0e45cb534413d1c20a4240955d6bb250bb4f10000c80bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0x23D641FeCcD207E8794c593e8240444A0674C4Ba"]},{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0x6245e67affA44a23077f0Ea7f981a8DC743a0c47",kind:"cl",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000c86245e67affa44a23077f0ea7f981a8dc743a0c47",pools:["0x9334BbCBE77C0883d704f71Db35CCF636639334c"]},{from:"0x6245e67affA44a23077f0Ea7f981a8DC743a0c47",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"cl",path:"0x6245e67affa44a23077f0ea7f981a8dc743a0c470000c80bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0x9334BbCBE77C0883d704f71Db35CCF636639334c"]},{from:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",to:"0xc72b96e0E48ecd4DC75E1e45396e26300BC39681",kind:"cl",path:"0x5fc5360d0400a0fd4f2af552add042d716f1d16800003cc72b96e0e48ecd4dc75e1e45396e26300bc39681",pools:["0x6290Be6e6913708866E6f17eaf3F4FCC7d3fdF67"]},{from:"0xc72b96e0E48ecd4DC75E1e45396e26300BC39681",to:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",kind:"cl",path:"0xc72b96e0e48ecd4dc75e1e45396e26300bc3968100003c5fc5360d0400a0fd4f2af552add042d716f1d168",pools:["0x6290Be6e6913708866E6f17eaf3F4FCC7d3fdF67"]},{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0x45242320DBB855EeA8Fd36804C6487E10E97FCF9",kind:"cl",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000c845242320dbb855eea8fd36804c6487e10e97fcf9",pools:["0xD53a623c17A5853838FA140cE5706eA008565dA8"]},{from:"0x45242320DBB855EeA8Fd36804C6487E10E97FCF9",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"cl",path:"0x45242320dbb855eea8fd36804c6487e10e97fcf90000c80bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0xD53a623c17A5853838FA140cE5706eA008565dA8"]},{from:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"v3",path:"0x5fc5360d0400a0fd4f2af552add042d716f1d1680000640bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0x52e65B17fB6E5BA00Ed806f37Afcd2DaA50271Ca"]},{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",kind:"v3",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000645fc5360d0400a0fd4f2af552add042d716f1d168",pools:["0x52e65B17fB6E5BA00Ed806f37Afcd2DaA50271Ca"]}],codeHashes:{"0x137731B8B2D7Cd24aB4A4A9061f2D7b4Fd1aBFEE":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C":"0x6f2a1713cbceba31cc630dddda1ef99cd35086c96005f3c9ea015f9a8e53e613","0xd7F3bCDAfCFf0018953BB6944Db2683Ff2e42b07":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0xfD7EE9D17BD6941bF8e612281ec23E857134BB92":"0x9cc155dd143657bba37e6a51fa28e78158e3f47454acdcebedc0512e3803d0fc","0xF5331Dc29A1FDe4b22d7F168661584B057228683":"0x9f1e0f8e488165740c5ab91a3da1bea1a75eeef607ea37b32296ad465971344c","0x4E8649Be40aE67EBbcff99C291B92eE03015917b":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3":"0x4350c8fcdf90361969542249d76c25d6afbd31f10bebf0134bfe21beba1e8f4c","0x5A725556514222d0cc81501A9294a3135b7C41C4":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0x89207bED2935C64d6cb105E9C85E0E2ED99DD8f2":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0x99e70A5b06215e5D2F3BeC773b4f59c008fc1673":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x5794bB61E83397049c40D87BbF3d44AF583A27Ce":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0x54Bd0805f549708144C811c14DdEeC0714CA5e0c":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0xB11ba9a4d345434c25d625C076f23Ad14abC6B3c":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x36759534741E28Eb052238738963D684bFe719E4":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0x8337c691C3afA52ccE418178e52ed472F034Cb8b":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0x23D641FeCcD207E8794c593e8240444A0674C4Ba":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x9818f01EDCcc3d8EB86B859931C3B877cf44A108":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0xdB739d906CD5101b65E089a284ec13a3ab21F603":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0x9334BbCBE77C0883d704f71Db35CCF636639334c":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x599ac767099bB6f01712867BfA1Fc1Aa27DEFD37":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0xbaEE86C9D7dE9dc192f17dFA62833B601Dc64D23":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0x6290Be6e6913708866E6f17eaf3F4FCC7d3fdF67":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x9619bFB1f2D97E2B23F23310205e4c2089c1A45d":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0x9a02CaA8a2e63659f8A419a29a3B48baD86d3c7a":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0xD53a623c17A5853838FA140cE5706eA008565dA8":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0xCaf681a66D020601342297493863E78C959E5cb2":"0x6f36c378e272c6324c48f045182bcb54bd8ad654cf9ebd42e8893d52c4cb25dc","0x33e885eD0Ec9bF04EcfB19341582aADCb4c8A9E7":"0x3db0868d945e9304c9bc6a8b2181948109ea617647142f3c4083e14393496a28","0x1f7d7550B1b028f7571E69A784071F0205FD2EfA":"0xec72b1abd1f2faee020cfea9c646bd8994f9fb389054f6e574f103a895091739","0xC062b870E813fcA720f1e002c234369Ab3aB9415":"0x11ea7d3599ef56eda32c0ce7ca26e9aae71bec13bfcbd3ad0e83826c1a2defe4","0x03983AB2C057a2eac211ff01738a1e49ff325B49":"0x1ed81396c831d69a6c59384019850c21ac672d24ae83b4b26304a7384e1e4096","0x52e65B17fB6E5BA00Ed806f37Afcd2DaA50271Ca":"0x3298b5dd4e6f115074c526a55ad05a36fd73a0034ac22ec6cbaab32cc9c1e8d2","0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73":"0x5706be52f64875fee65a2cec0d80e47a23d8793cbe85d214b48445e2d05f5353","0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3":"0xa2cf7f366f3d8d11e611acecf7916a27308ba041bf1e161bddbd4ecbb9402b6a"},delegates:{"0x137731B8B2D7Cd24aB4A4A9061f2D7b4Fd1aBFEE":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0x4E8649Be40aE67EBbcff99C291B92eE03015917b":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x5A725556514222d0cc81501A9294a3135b7C41C4":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0x99e70A5b06215e5D2F3BeC773b4f59c008fc1673":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x5794bB61E83397049c40D87BbF3d44AF583A27Ce":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0xB11ba9a4d345434c25d625C076f23Ad14abC6B3c":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x36759534741E28Eb052238738963D684bFe719E4":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0x23D641FeCcD207E8794c593e8240444A0674C4Ba":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x9818f01EDCcc3d8EB86B859931C3B877cf44A108":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0x9334BbCBE77C0883d704f71Db35CCF636639334c":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x599ac767099bB6f01712867BfA1Fc1Aa27DEFD37":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0x6290Be6e6913708866E6f17eaf3F4FCC7d3fdF67":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x9619bFB1f2D97E2B23F23310205e4c2089c1A45d":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0xD53a623c17A5853838FA140cE5706eA008565dA8":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3"}};var De=q.vaults,we=["beefy_clm_swap","beefy_clm_deposit","beefy_clm_withdraw"],Z=P(["function wants() view returns(address,address)","function strategy() view returns(address)","function want() view returns(address)","function implementation() view returns(address)","function pool() view returns(address)","function vault() view returns(address)","function price() view returns(uint256)","function paused() view returns(bool)","function isCalm() view returns(bool)","function actionableAt() view returns(uint256)","function token0() view returns(address)","function token1() view returns(address)","function factory() view returns(address)","function tickSpacing() view returns(int24)","function balances() view returns(uint256,uint256)","function previewDeposit(uint256,uint256) view returns(uint256 shares,uint256 amount0,uint256 amount1,uint256 fee0,uint256 fee1)","function previewWithdraw(uint256) view returns(uint256,uint256)","function deposit(uint256 amount0,uint256 amount1,uint256 minShares)","function withdraw(uint256 shares,uint256 minAmount0,uint256 minAmount1)"]),ce=P(["function exactInput((bytes path,address recipient,uint256 deadline,uint256 amountIn,uint256 amountOutMinimum)) payable returns(uint256)"]),W=P(["function exactInput((bytes path,address recipient,uint256 amountIn,uint256 amountOutMinimum)) payable returns(uint256)","function multicall(uint256 deadline,bytes[] data) payable returns(bytes[])"]),Fe=P(["function quoteExactInput(bytes path,uint256 amountIn) returns(uint256,uint160[],uint32[],uint256)"]),ge={cl:P(["function getPool(address,address,int24) view returns(address)"]),v3:P(["function getPool(address,address,uint24) view returns(address)"])},ye=P(["function deposit() payable"]),z={vault:Y,chainId:{const:S},slippageBps:{type:"integer",minimum:0,maximum:500}},Be=10n**36n,K=he(de[S].uniswap.WETH.address),ve="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",ke=Object.fromEntries(Object.entries(q.codeHashes).map(([d,s])=>[d.toLowerCase(),s])),Ae=Object.fromEntries(Object.entries(q.delegates).map(([d,s])=>[d.toLowerCase(),s]));function f(d){return fe(d,"Provide a token or vault address.",oe)}function F(d){return re(d,"Invalid Beefy CLM integer.")}function G(d,s=!1){return se(d,"Provide a positive amount that fits uint256.",{notString:"Provide a decimal base-unit integer string.",positive:!s})}function Q(d){let s=d??50;if(typeof s!="number"||!Number.isInteger(s)||s<0||s>500)throw new o("Use integer slippageBps from 0 to 500.");return BigInt(s)}function X(d,s){let m=d*(10000n-s)/10000n;if(m<=0n)throw new o("This CLM amount is too small for a positive output minimum.");return m}function ne(d,s){if(!Array.isArray(d)||d.length!==s)throw new o("Invalid Beefy CLM quote.");return d.map(F)}function Se(d){let s=f(d),m=De.find(b=>I(b.vault,s));if(!m)throw new o("This vault has no qualified Beefy CLM route. Use beefy_withdraw to return existing vault shares to their want; redeem that want through the project app if Oak has no qualified redemption route.");return m}function Me(d,s,m,b,h){if(d<=0n||m<=0n||b<0n||h<0n)throw new o("The CLM price or budget is invalid.");let x=s?d*m/Be:d;if(x===0n)throw new o("The CLM budget is too small at the current pool price.");let e=b*m/Be,t=h>e?h-e:e-h,a=x<t?x:t,r=(x-a)/2n,c=d*(h>e?a+r:r)/x;return[c,d-c]}var xe=d=>{async function s(e){try{return await e()}catch(t){throw new o(d.plainError(t))}}function m(e,t){if(e.chainId!==void 0&&e.chainId!==S)throw new o("Beefy CLM requires chain 4663.");for(let a of Object.keys(e))if(!["vault","chainId",...t].includes(a))throw new o(`Unsupported Beefy CLM input: ${a}.`);return Se(e.vault)}async function b(e,t){be(t);let a=d.clientFor(S);if(await a.getChainId()!==S)throw new o("The Beefy CLM endpoint must report chain 4663.");let r=F(await a.getBlockNumber()),c=await a.getBlock({blockNumber:r}),n=(B,p,A=[])=>a.readContract({address:f(B),abi:Z,functionName:p,args:A,blockNumber:r}),i=new Set;async function l(B){let p=B.toLowerCase();if(i.has(p))return;let A=ke[p];if(!A)throw new o("Unqualified Beefy CLM dependency; no transaction was built.");let D=await a.getCode({address:f(B),blockNumber:r});if(!D||Ce(D)!==A)throw new o("A Beefy CLM contract or delegated implementation no longer matches its pinned code.");i.add(p),Ae[p]&&await l(Ae[p])}await me(a,f(e.vault),r);for(let B of[e.manager,e.strategy,e.beacon,e.implementation,e.pool,e.factory])await l(B);let[g,u,y,E,C,k,w,M,R,ee]=await Promise.all([n(e.vault,"want"),n(e.manager,"wants"),n(e.manager,"strategy"),n(e.beacon,"implementation"),n(e.strategy,"pool"),n(e.strategy,"vault"),n(e.pool,"token0"),n(e.pool,"token1"),n(e.pool,"factory"),n(e.pool,"tickSpacing")]);if(f(g)!==e.manager||!Array.isArray(u)||u.length!==2||u.some((B,p)=>f(B)!==e.wants[p])||f(y)!==e.strategy||f(E)!==e.implementation||f(C)!==e.pool||f(k)!==e.manager||f(w)!==e.wants[0]||f(M)!==e.wants[1]||f(R)!==e.factory||ee!==e.tickSpacing)throw new o("The Beefy CLM want, tokens, strategy, beacon or pool differs from its qualified deployment.");let V=async B=>F(await a.readContract({address:f(B),abi:te,functionName:"balanceOf",args:[t],blockNumber:r}));async function ae(B){let p=f(B),[A,D]=await Promise.all([a.readContract({address:p,abi:te,functionName:"symbol",blockNumber:r}),a.readContract({address:p,abi:te,functionName:"decimals",blockNumber:r})]);if(typeof A!="string"||!A.trim()||!Number.isInteger(D)||D<0||D>255)throw new o("Invalid CLM token metadata.");return{address:p,symbol:A,decimals:D,chainId:S}}async function U(){let p=(await le(d.http,"https://api.beefy.finance/vaults",{},v=>Array.isArray(v)&&v.every($=>$!==null&&typeof $=="object"))).filter(v=>v.chain==="robinhood"&&typeof v.earnContractAddress=="string"&&I(v.earnContractAddress,e.vault)),A=p[0],D=pe(f(e.vault));if(p.length!==1||!A||A.id!==D.id||A.type!=="standard"||f(A.tokenAddress)!==e.manager||A.tokenDecimals!==18)throw new o("The Beefy API and qualified CLM vault disagree.");if(A.status!=="active")throw new o(`Beefy marks this vault ${String(A.status)}; deposits are unavailable. Exit with beefy_withdraw, redeem the returned CLM shares with beefy_clm_withdraw, then swap the received tokens to USDG with beefy_clm_swap.`);let L=f(await n(e.vault,"strategy")),_=await Promise.all([n(L,"paused"),n(e.strategy,"paused")]);if(_.some(v=>typeof v!="boolean"))throw new o("Invalid Beefy strategy pause flag.");if(_.some(Boolean))throw new o("The Beefy strategy is paused; deposits are unavailable. Exit with beefy_withdraw, redeem CLM shares with beefy_clm_withdraw, then convert the tokens to USDG with beefy_clm_swap.");if(await n(e.manager,"isCalm")!==!0)throw new o("The CLM pool is not calm; wait and request a fresh deposit preview.")}async function N(B,p){let A=new Set([...e.wants,f(ie),K]);if(!A.has(B)||!A.has(p)||B===p)throw new o("Use this CLM pair or the USDG/WETH conversion route, with different input and output tokens.");let D=q.routes.find(H=>H.from===B&&H.to===p&&(H.pools[0]===e.pool||H.kind==="v3"));if(!D)throw new o("No qualified direct CLM route for this token pair. Convert through the CLM bridge token in separately mined steps.");let L=q.markets[D.kind];for(let H of[L.router,L.quoter,L.factory,...D.pools])await l(H);let _=D.path;if(_.length!==88||f(_.slice(0,42))!==B||f(`0x${_.slice(-40)}`)!==p)throw new o("Invalid qualified CLM swap path.");let v=Number.parseInt(_.slice(42,48),16),$=await a.readContract({address:f(L.factory),abi:ge[D.kind],functionName:"getPool",args:[B,p,v],blockNumber:r});if(f($)!==D.pools[0])throw new o("The swap factory no longer selects the qualified CLM pool.");if(f(await n(L.quoter,"factory"))!==L.factory)throw new o("The CLM quoter factory differs from its pin.");return D}async function j(B,p,A){let D=await N(B,p),L=q.markets[D.kind],_=await a.simulateContract({address:f(L.quoter),abi:Fe,functionName:"quoteExactInput",args:[D.path,A],account:t,blockNumber:r}),v=F(_.result[0]);if(v===0n)throw new o("No positive quote for this CLM swap.");return{selected:D,market:L,out:v}}return{client:a,blockNumber:r,deadline:c.timestamp+600n,read:n,balance:V,token:ae,code:l,entryAvailable:U,quote:j}}function h(e,t,a,r="0"){return d.unsignedTx({to:f(e),data:t,description:a,value:r,chainId:S})}async function x(e,t,a){let r=await d.preview(e,t);return{txs:e,preview:r,summary:`${a} Re-read actual balances after every mined step. Calls are separate transactions; earlier steps can remain mined if a later step fails. Confirm the local preview. Gas is additional.`}}return{tools:[{name:"beefy_lp",inputSchema:{type:"object",properties:{...z,amount:{...O(),description:"Optional entry budget in the CLM bridge token base units (USDG or WETH)."}},required:["vault"],additionalProperties:!1},execute:(e,t)=>s(async()=>{let a=m(e,["amount","slippageBps"]),r=Q(e.slippageBps),c=await b(a,t),[n,i,l,g,u,y,E,C]=await Promise.all([c.token(a.wants[0]),c.token(a.wants[1]),c.token(a.manager),c.balance(a.wants[0]),c.balance(a.wants[1]),c.balance(a.manager),c.read(a.manager,"balances"),c.read(a.strategy,"price")]),k;if(e.amount!==void 0){await c.entryAvailable();let w=G(e.amount),[M,R]=ne(E,2),ee=Me(w,a.bridge===n.address,F(C),M,R),V=[];for(let[ae,U]of[n,i].entries()){let N=ee[ae],j=N===0n||U.address===a.bridge?N:(await c.quote(f(a.bridge),U.address,N)).out;V.push({token:U,bridgeAmount:N.toString(),expectedAmount:j.toString(),minimumAmount:j===0n?"0":X(j,r).toString(),swapRequired:N>0n&&U.address!==a.bridge})}k={bridge:await c.token(a.bridge),budget:w.toString(),inputs:V,source:"strategy.price() and CLM balances(); imbalance first, then split remaining value equally. Re-quote after mining swaps."}}return{chainId:S,vault:a.vault,manager:a.manager,bridge:await c.token(a.bridge),constituents:[{token:n,balance:g.toString()},{token:i,balance:u.toString()}],shares:{token:l,amount:y.toString()},entryPlan:k,block:c.blockNumber.toString(),summary:"Convert USDG or ETH to the bridge token with beefy_clm_swap. Use entryPlan to acquire the current deposit ratio, including a one-sided ratio when appropriate. Deposit actual balances with beefy_clm_deposit, then deposit mined CLM shares with beefy_deposit. Exit with beefy_withdraw, beefy_clm_withdraw, then beefy_clm_swap through the bridge token to USDG."}})},{name:"beefy_clm_swap",inputSchema:{type:"object",properties:{...z,from:Y,to:Y,amount:O()},required:["vault","from","to","amount"],additionalProperties:!1},execute:(e,t)=>s(async()=>{let a=m(e,["from","to","amount","slippageBps"]),r=Q(e.slippageBps),c=f(e.from),n=f(e.to),i=G(e.amount),l=c.toLowerCase()===ve,g=l?K:c,u=await b(a,t);if((l?await u.client.getBalance({address:t,blockNumber:u.blockNumber}):await u.balance(c))<i)throw new o("Insufficient CLM swap balance; keep ETH for gas.");let y=[];l&&(await u.code(K),y.push(h(K,T({abi:ye,functionName:"deposit"}),"Wrap exactly the requested ETH for the CLM workflow.",i.toString())));let E=i,C=i;if(g!==n){let w=await u.quote(g,n,i);E=w.out,C=X(E,r),y.push(d.approval(g,f(w.market.router),i.toString(),S));let M={path:w.selected.path,recipient:t,amountIn:i,amountOutMinimum:C},R=w.selected.kind==="cl"?T({abi:ce,functionName:"exactInput",args:[{...M,deadline:u.deadline}]}):T({abi:W,functionName:"multicall",args:[u.deadline,[T({abi:W,functionName:"exactInput",args:[M]})]]});y.push(h(w.market.router,R,`Swap exact input with at least ${C} output base units to the calling wallet.`))}else if(!l)throw new o("The CLM swap requires different input and output tokens.");let k=await u.token(n);return{...await x(y,t,"Swap qualified CLM constituents. Venue fees are included in the quote."),output:{token:k,amount:E.toString()},minimumOutput:{token:k,amount:C.toString()},deadline:u.deadline.toString()}})},{name:"beefy_clm_deposit",inputSchema:{type:"object",properties:{...z,amount0:O(),amount1:O()},required:["vault","amount0","amount1"],additionalProperties:!1},execute:(e,t)=>s(async()=>{let a=m(e,["amount0","amount1","slippageBps"]),r=Q(e.slippageBps),c=G(e.amount0,!0),n=G(e.amount1,!0);if(c===0n&&n===0n)throw new o("At least one CLM deposit amount must be positive.");let i=await b(a,t);if(await i.entryAvailable(),await i.balance(a.wants[0])<c||await i.balance(a.wants[1])<n)throw new o("Acquire the CLM constituents first and retry with their mined balances.");let[l,g,u,y,E]=ne(await i.read(a.manager,"previewDeposit",[c,n]),5);if(g>c||u>n||g+u===0n||y>g||E>u)throw new o("The CLM returned invalid deposit amounts or fees.");let C=X(l,r),k=[];for(let[w,M]of[c,n].entries())M>0n&&k.push(d.approval(f(a.wants[w]),f(a.manager),M.toString(),S));k.push(h(a.manager,T({abi:Z,functionName:"deposit",args:[c,n,C]}),`Mint at least ${C} CLM share base units to the calling wallet.`));for(let[w,M]of[c,n].entries())M>0n&&k.push(d.approval(f(a.wants[w]),f(a.manager),"0",S));return{...await x(k,t,"Mint CLM want shares with a positive share minimum and exact input approvals. Final revocations clear any unused allowance. Deposit the actual shares received into beefy_deposit separately."),output:{token:await i.token(a.manager),amount:l.toString()},minimumShares:C.toString(),usedAmounts:[g.toString(),u.toString()],fees:[y.toString(),E.toString()]}})},{name:"beefy_clm_withdraw",inputSchema:{type:"object",properties:{...z,shares:{anyOf:[O(),{const:"all"}]}},required:["vault","shares"],additionalProperties:!1},execute:(e,t)=>s(async()=>{let a=m(e,["shares","slippageBps"]),r=Q(e.slippageBps),c=e.shares==="all"?void 0:G(e.shares),n=await b(a,t),i=await n.balance(a.manager),l=c??i;if(l===0n||l>i)throw new o("Withdraw vault shares first, then provide a positive CLM share amount no greater than your mined balance.");let u=ne(await n.read(a.manager,"previewWithdraw",[l]),2).map(E=>E===0n?0n:X(E,r));if(u.every(E=>E===0n))throw new o("No positive CLM withdrawal output is available.");let y=[h(a.manager,T({abi:Z,functionName:"withdraw",args:[l,u[0],u[1]]}),"Redeem CLM shares and return the pair tokens to the calling wallet.")];return{...await x(y,t,"Redeem CLM shares. Convert actual returned tokens, including leftover deposit dust, through the bridge token to USDG with beefy_clm_swap after mining. Strategy pause or API status does not prevent requesting this preview."),minimumOutputs:await Promise.all(u.map(async(E,C)=>({token:await n.token(a.wants[C]),amount:E.toString()})))}})}]}};async function je(d,s,m,b){if(!we.includes(d))throw new o("Unknown Beefy CLM action.");let h=async()=>{throw new o("Beefy CLM reconstruction uses only qualified on-chain routes.")},x=ue({clientFor:()=>b,http:fetch,quoteSwap:h,buildSwap:h,preview:async t=>({txs:t,changes:[],summary:"Locally reconstructed CLM intent; local preview still required."})});return(await xe(x).tools.find(t=>t.name===d).execute(s,m)).txs}function Ge(d,s,m){let b=()=>{throw new o("Beefy CLM calldata differs from locally reconstructed intent; nothing was signed.")};function h(x,e,t){if(x===e)return;let a=J({abi:t,data:x}),r=J({abi:t,data:e});(a.functionName!==r.functionName||!a.args||!r.args)&&b();let c=[...a.args],n=[...r.args];if(I(T({abi:t,functionName:a.functionName,args:c}),x)||b(),a.functionName==="deposit"||a.functionName==="withdraw")for(let i of a.functionName==="deposit"?[2]:[1,2])F(c[i])<F(n[i])&&b(),c[i]=n[i];else if(a.functionName==="multicall"){let i=F(c[0]);(i<=m||i>F(n[0]))&&b(),(!Array.isArray(c[1])||!Array.isArray(n[1])||c[1].length!==1||n[1].length!==1)&&b(),h(c[1][0],n[1][0],W),c[0]=n[0],c[1]=n[1]}else if(a.functionName==="exactInput"){let i={...c[0]},l=n[0];F(i.amountOutMinimum)<F(l.amountOutMinimum)&&b(),i.amountOutMinimum=l.amountOutMinimum,"deadline"in i&&((F(i.deadline)<=m||F(i.deadline)>F(l.deadline))&&b(),i.deadline=l.deadline),c[0]=i}else b();I(T({abi:t,functionName:a.functionName,args:c}),e)||b()}(!s.length||d.length!==s.length)&&b();for(let[x,e]of d.entries()){let t=s[x];(e.chainId!==t.chainId||!I(e.to,t.to)||e.value!==t.value)&&b();try{if(I(t.to,q.markets.cl.router))J({abi:ce,data:t.data}).args[0].deadline<=m&&b();else if(I(t.to,q.markets.v3.router)){let a=J({abi:W,data:t.data});(a.functionName!=="multicall"||a.args[0]<=m)&&b()}}catch{b()}if(!I(e.data,t.data))try{let a=De.find(r=>I(r.manager,t.to));h(e.data,t.data,a?Z:I(t.to,q.markets.cl.router)?ce:W)}catch{b()}}}var We=d=>({tools:xe(d).tools.slice(1)});export{De as a,we as b,Z as c,ce as d,W as e,Se as f,Me as g,xe as h,je as i,Ge as j,We as k};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as s}from"./XSD5NL7J.js";import{isAddress as d}from"viem";var p="https://api-v2.pendle.finance/core/v3/sdk/4663/convert",n=class extends s{constructor(o,r){super(r);this.kind=o}kind};function i(e){if(!e||typeof e!="object"||Array.isArray(e))throw new n("malformed","Pendle sent an incomplete or malformed quote. Try again.");return e}function m(e){if(typeof e!="string"||!/^[0-9]+$/.test(e)||e.length>78||BigInt(e)>=1n<<256n)throw new n("malformed","Pendle sent a malformed token amount. Try again.");return BigInt(e)}function l(e){if(typeof e!="string"||!d(e,{strict:!1}))throw new n("malformed","Pendle sent a malformed token or contract address. Try again.");return e}function c(e){let t=i(e);if(!Array.isArray(t.routes)||!t.routes.length||!Array.isArray(t.requiredApprovals))throw new n("malformed","Pendle sent an incomplete quote. Try again.");let o=i(t.routes[0]),r=i(o.tx);if(l(r.to),typeof r.data!="string"||!/^0x(?:[0-9a-fA-F]{2})+$/.test(r.data)||!Array.isArray(o.outputs)||!o.outputs.length)throw new n("malformed","Pendle sent incomplete transaction details. Try again.");return i(o.data),o}async function g(e,t){if(!Number.isInteger(t.slippageBps)||t.slippageBps<0||t.slippageBps>1e4||t.amount<=0n||t.amount>=1n<<256n)throw new s("Provide a positive token amount and a valid slippage limit.");let o=Date.now(),r;try{r=await e(p,{method:"POST",headers:{"User-Agent":"oak-core/pendle","Content-Type":"application/json"},body:JSON.stringify({inputs:[{token:t.inputToken,amount:t.amount.toString()}],outputs:[t.outputToken],receiver:t.wallet,slippage:t.slippageBps/1e4,enableAggregator:!1}),signal:AbortSignal.timeout(15e3)})}catch{throw new n("unavailable","Pendle's price service isn't answering. Try again later.")}let a;try{a=await r.json()}catch{throw r.status===403?new n("forbidden","Pendle's price service refused the request. Try again later."):r.ok?new n("malformed","Pendle sent a malformed quote. Try again."):new n("http","Pendle's price service isn't answering. Try again later.")}if(!r.ok)throw JSON.stringify(a).includes("INPUT_VALUATION_TOO_LOW")?new n("dust","This amount is too small for Pendle to quote. Try a larger amount."):r.status===403?new n("forbidden","Pendle's price service refused the request. Try again later."):new n("http","Pendle's price service isn't answering. Try again later.");return c(a),{body:a,receivedAt:o}}export{p as a,n as b,i as c,m as d,l as e,c as f,g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as N,b as _,c as $}from"./64WKYWZV.js";import{e as O}from"./IMRXZ7JB.js";import{b as k,c as R}from"./RVO3QK2B.js";import{a as q,c as u,d as f,f as S,g as I}from"./UHRCM7AG.js";import{g as B}from"./EU3OAJU2.js";import{a as b,c as A}from"./PBQSJSZO.js";import{b as v}from"./5ZLOCQA4.js";import{a as x}from"./FWD4L3CJ.js";import{a as s}from"./XSD5NL7J.js";import{erc20Abi as j}from"viem";var K=n=>{function w(e,t){if(Object.keys(e).some(m=>!t.includes(m)))throw new s("Use only the inputs shown for this Pendle tool. YT and LP actions are not supported.")}function C(e){if(typeof e!="string"||!/^[0-9]+$/.test(e)||e.length>78)throw new s("Provide a positive decimal base-unit amount as a string.");return k(BigInt(e),!0)}function U(e,t){let m=e==="stable"?100:200,r=t===void 0?e==="stable"?50:100:t;if(typeof r!="number"||!Number.isInteger(r)||r<0)throw new s("Slippage must be a whole number of basis points.");if(r>m)throw new s(`Oak won't accept a price move that big. The most it allows is ${m/100}%.`);return r}async function y(e,t,m){w(t,["market","amount","slippageBps"]),u(f(m,n.wallet),"wallet does not match this request"),b(t.market);for(let r=0;r<2;r++){let a=await n.verify(t.market);u(f(a.market,t.market),"verified market does not match the request");let c=await n.client.getBlock();if(a.expired||c.timestamp>=BigInt(a.expiry))throw new s("This Pendle term has ended. Use pendle_redeem to cash out.");let d=U(a.kind,t.slippageBps),o=e==="sell"&&t.amount==="max"?k(await n.client.readContract({address:a.pt,abi:j,functionName:"balanceOf",args:[n.wallet],blockNumber:c.number}),!0):C(t.amount),i=e==="buy"?a.inputToken:a.pt,l=e==="buy"?a.pt:a.inputToken,p=await B(n.http,{inputToken:i,outputToken:l,amount:o,wallet:n.wallet,slippageBps:d}),h=(e==="buy"?S:I)(p.body,{market:a,wallet:n.wallet,amount:o,slippageBps:d});if(Math.abs(h.priceImpact)>.03)throw new s("This is a thin market and your size moves the price too much. Try a smaller amount.");if(Date.now()-p.receivedAt>3e4)continue;await R(n.client,a,e,o,h.amountOut,h.priceImpact);let P=Date.now()-p.receivedAt;if(!(P<0||P>3e4))return{txs:[A(i,q,o.toString(),x),h.tx],summary:e==="buy"?"Approve the exact input amount, then buy Pendle PT.":"Approve the exact PT amount, then sell early at today\u2019s market price."}}throw new s("Pendle\u2019s quote became too old. Try again for a fresh price.")}async function M(e,t){w(e,["market","minOutBps"]),u(f(t,n.wallet),"wallet does not match this request");let m=N(e.minOutBps),r;if(e.market==="all")try{r=await O(n.client)}catch{throw new s("Oak could not read ended Pendle markets from the chain. Provide one ended market address to cash it out.")}else b(e.market),r=[e.market];let a=[];for(let o of r){let i=await n.verify(o);if(u(f(i.market,o),"verified market does not match the request"),e.market==="all"&&!i.expired)continue;let l=k(await n.client.readContract({address:i.pt,abi:j,functionName:"balanceOf",args:[n.wallet]}));l!==0n&&a.push({verified:i,balance:l})}if(a.length>1)throw new s(`Ended Pendle terms are cashed out one at a time. Run pendle_redeem with one of these market addresses: ${a.map(({verified:o})=>o.market).join(", ")}.`);let c=[],d=[];for(let{verified:o,balance:i}of a){let l=await _(n,o,i,m);c.push(...l.txs);let p=await $(n,o,i,l.expected,m);p&&d.push(p)}return{txs:c,summary:c.length?["Cash out ended Pendle PT balances to each market\u2019s input token.",...d].join(" "):"No PT balance in the selected ended Pendle terms."}}let g={type:"string",pattern:"^0x[0-9a-fA-F]{40}$",description:"Pendle market address returned by pendle_list."},T={type:"integer",minimum:0,maximum:200,description:"USDG: default 50, cap 100 bps. Stock tokens: default 100, cap 200 bps; the verified market determines the cap."};return[{name:"pendle_buy",inputSchema:{type:"object",properties:{market:g,amount:v("Positive decimal base units of the market input token; read its decimals first."),slippageBps:T},required:["market","amount"],additionalProperties:!1},execute:(e,t)=>y("buy",e,t)},{name:"pendle_sell",inputSchema:{type:"object",properties:{market:g,amount:{type:"string",anyOf:[{pattern:"^[0-9]+$"},{const:"max"}],description:"PT decimal base units, or max for the full PT balance."},slippageBps:T},required:["market","amount"],additionalProperties:!1},execute:(e,t)=>y("sell",e,t)},{name:"pendle_redeem",inputSchema:{type:"object",properties:{market:{type:"string",anyOf:[{pattern:"^0x[0-9a-fA-F]{40}$"},{const:"all"}],description:"Ended market address, or all ended markets held by this wallet."},minOutBps:{type:"integer",minimum:0,maximum:50,default:10,description:"Maximum reduction from the on-chain redemption estimate, in basis points."}},required:["market"],additionalProperties:!1},execute:M}]};export{K as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Me,d as Ce,e as we,f as ie,i as be,j as Ne}from"./HVM2EEXB.js";import{b as ne,o as ge}from"./GHPREYQK.js";import{a as O,b as me}from"./PBQSJSZO.js";import{a as Ue}from"./BQICZFLR.js";import{a as W,c as Te}from"./UP7FBDMJ.js";import{a as k,i as _}from"./FWD4L3CJ.js";import{a as c,b as te,e as T}from"./XSD5NL7J.js";import{decodeFunctionResult as he,encodeFunctionData as R,getAddress as l,parseAbi as Z,zeroAddress as M}from"viem";var re=-887272,se=887272,z=(1n<<128n)-1n,ze="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Ge="0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",je="0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f",oe=2000n,Ke=5,$e=64n,Qe=1800n,f=Object.freeze({factory:l(_[4663].uniswap.v3_factory.address),positionManager:l(_[4663].uniswap.v3_position_manager.address),swapRouter02:l(_[4663].uniswap.swap_router02.address),permit2:l(_[4663].uniswap.permit2.address),weth:l(_[4663].uniswap.WETH.address),usdg:l(_[4663].uniswap.USDG.address),ethUsdgPool:l(_[4663].oracle.ethUsdgPool.address)}),ve=Object.freeze({100:1,500:10,3e3:60,1e4:200}),ht=Object.freeze([{fee:100,tickSpacing:1,address:l("0x52e65B17fB6E5BA00Ed806f37Afcd2DaA50271Ca"),token0:f.weth,token1:f.usdg,recordedLiquidity:"1957537485734736219",recordedSqrtPriceX96:"3839219776288481168641554",recordedTick:-198707,feeProtocol:68},{fee:500,tickSpacing:10,address:l("0x69bfaf19c9f377bb306a89aed9f6b07e2c1a8d9a"),token0:f.weth,token1:f.usdg,recordedLiquidity:"714542894544667104",recordedSqrtPriceX96:"3839644024453020182443671",recordedTick:-198705,feeProtocol:68},{fee:3e3,tickSpacing:60,address:l("0xa9188730fe85be88ad499d7d52b099e800fb0334"),token0:f.weth,token1:f.usdg,recordedLiquidity:"310559629687003603",recordedSqrtPriceX96:"3843235825752878635548672",recordedTick:-198686,feeProtocol:102},{fee:1e4,tickSpacing:200,address:l("0x5f009e071f07e92b6c624e83f52f17bbda34680d"),token0:f.weth,token1:f.usdg,recordedLiquidity:"5822966536584155",recordedSqrtPriceX96:"3853297838190389678059735",recordedTick:-198634,feeProtocol:102}]),v=Z(["function positions(uint256 tokenId) view returns (uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1)","function ownerOf(uint256 tokenId) view returns (address)","function balanceOf(address owner) view returns (uint256)","function tokenOfOwnerByIndex(address owner, uint256 index) view returns (uint256)","function mint((address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint256 amount0Desired, uint256 amount1Desired, uint256 amount0Min, uint256 amount1Min, address recipient, uint256 deadline) params) payable returns (uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1)","function increaseLiquidity((uint256 tokenId, uint256 amount0Desired, uint256 amount1Desired, uint256 amount0Min, uint256 amount1Min, uint256 deadline) params) payable returns (uint128 liquidity, uint256 amount0, uint256 amount1)","function decreaseLiquidity((uint256 tokenId, uint128 liquidity, uint256 amount0Min, uint256 amount1Min, uint256 deadline) params) payable returns (uint256 amount0, uint256 amount1)","function collect((uint256 tokenId, address recipient, uint128 amount0Max, uint128 amount1Max) params) payable returns (uint256 amount0, uint256 amount1)","function burn(uint256 tokenId) payable","function createAndInitializePoolIfNecessary(address token0, address token1, uint24 fee, uint160 sqrtPriceX96) payable returns (address pool)"]),Q=Z(["function getPool(address tokenA, address tokenB, uint24 fee) view returns (address pool)","function feeAmountTickSpacing(uint24 fee) view returns (int24)"]),ke=Z(["function slot0() view returns (uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked)","function liquidity() view returns (uint128)","function tickSpacing() view returns (int24)","function fee() view returns (uint24)","function token0() view returns (address)","function token1() view returns (address)"]),Ye=Z(["function exactInputSingle((address tokenIn, address tokenOut, uint24 fee, address recipient, uint256 amountIn, uint256 amountOutMinimum, uint160 sqrtPriceLimitX96) params) payable returns (uint256 amountOut)"]),ye=Z(["function decimals() view returns (uint8)","function symbol() view returns (string)","function allowance(address owner, address spender) view returns (uint256)"]),Ze="0xd0e30db0";function Je(t){if(typeof t!="string")return!1;let e=t.trim().toLowerCase();return e===M||e===ze||e==="eth"||e==="native"}function E(t,e){if(Je(t))throw new c(`Uniswap v3 requires wrapped ERC-20 WETH (${f.weth}) rather than native ETH in ${e}.`);if(typeof t!="string")throw new c(`${e} must be a valid 20-byte hex address.`);return O(t),l(t)}function et(t,e,n){let a=Number(t),i=Number(e),o=Number(n);if(!Number.isInteger(o)||o<=0)throw new c("Uniswap v3 tickSpacing must be a positive integer.");if(!Number.isInteger(a)||!Number.isInteger(i))throw new c("Uniswap v3 tickLower and tickUpper must be integers.");if(a<re||i>se||a>se||i<re)throw new c(`Uniswap v3 ticks are out of bounds [${re}, ${se}].`);if(a>=i)throw new c("Uniswap v3 tickLower must be strictly less than tickUpper.");if(a%o!==0||i%o!==0)throw new c(`Uniswap v3 tickLower (${a}) and tickUpper (${i}) must be divisible by tickSpacing (${o}).`);return{tickLower:a,tickUpper:i,tickSpacing:o}}function tt(t,e){let n=t.trim(),a=n.startsWith("-"),i=a||n.startsWith("+")?n.slice(1):n,o=Te(W(i).toString(),e);return a&&o!=="0"?`-${o}`:o}function nt(t){let e=typeof t=="string"?he({abi:v,functionName:"positions",data:t}):t;return{nonce:BigInt(e[0]),operator:l(String(e[1])),token0:l(String(e[2])),token1:l(String(e[3])),fee:Number(e[4]),tickLower:Number(e[5]),tickUpper:Number(e[6]),liquidity:BigInt(e[7]),feeGrowthInside0LastX128:BigInt(e[8]),feeGrowthInside1LastX128:BigInt(e[9]),tokensOwed0:BigInt(e[10]),tokensOwed1:BigInt(e[11])}}function Le(t,e){if(!t||!Array.isArray(t.logs))return[];let n=e?l(e).toLowerCase():void 0,a=f.positionManager.toLowerCase(),i=new Set;for(let o of t.logs){if(!o||typeof o.address!="string"||o.address.toLowerCase()!==a)continue;let r=Array.isArray(o.topics)?o.topics.map(u=>String(u).toLowerCase()):[],s=r[0];if(s===Ge&&r.length>=4){let d=`0x${r[2].slice(-40)}`;if(!n||d===n){let p=BigInt(r[3]).toString();p!=="0"&&i.add(p)}}else if(s===je&&r.length>=2&&!n){let u=BigInt(r[1]).toString();u!=="0"&&i.add(u)}}return[...i]}function vt(t){let e=n=>typeof n=="bigint"?n:W(n);return R({abi:Ye,functionName:"exactInputSingle",args:[{tokenIn:l(t.tokenIn),tokenOut:l(t.tokenOut),fee:t.fee,recipient:l(t.recipient),amountIn:e(t.amountIn),amountOutMinimum:e(t.amountOutMinimum),sqrtPriceLimitX96:t.sqrtPriceLimitX96!==void 0?e(t.sqrtPriceLimitX96):0n}]})}var Re=1n<<96n;function _e(t){let e=Math.abs(t),n=(e&1)!==0?0xfffcb933bd6fad37aa2d162d1a594001n:0x100000000000000000000000000000000n;return(e&2)!==0&&(n=n*0xfff97272373d413259a46990580e213an>>128n),(e&4)!==0&&(n=n*0xfff2e50f5f656932ef12357cf3c7fdccn>>128n),(e&8)!==0&&(n=n*0xffe5caca7e10e4e61c3624eaa0941cd0n>>128n),(e&16)!==0&&(n=n*0xffcb9843d60f6159c9db58835c926644n>>128n),(e&32)!==0&&(n=n*0xff973b41fa98c081472e6896dfb254c0n>>128n),(e&64)!==0&&(n=n*0xff2ea16466c96a3843ec78b326b52861n>>128n),(e&128)!==0&&(n=n*0xfe5dee046a99a2a811c461f1969c3053n>>128n),(e&256)!==0&&(n=n*0xfcbe86c7900a88aedcffc83b479aa3a4n>>128n),(e&512)!==0&&(n=n*0xf987a7253ac413176f2b074cf7815e54n>>128n),(e&1024)!==0&&(n=n*0xf3392b0822b70005940c7a398e4b70f3n>>128n),(e&2048)!==0&&(n=n*0xe7159475a2c29b7443b29c7fa6e889d9n>>128n),(e&4096)!==0&&(n=n*0xd097f3bdfd2022b8845ad8f792aa5825n>>128n),(e&8192)!==0&&(n=n*0xa9f746462d870fdf8a65dc1f90e061e5n>>128n),(e&16384)!==0&&(n=n*0x70d869a156d2a1b890bb3df62baf32f7n>>128n),(e&32768)!==0&&(n=n*0x31be135f97d08fd981231505542fcfa6n>>128n),(e&65536)!==0&&(n=n*0x9aa508b5b7a84e1c677de54f3e99bc9n>>128n),(e&131072)!==0&&(n=n*0x5d6af8dedb81196699c329225ee604n>>128n),(e&262144)!==0&&(n=n*0x2216e584f5fa1ea926041bedfe98n>>128n),(e&524288)!==0&&(n=n*0x48a170391f7dc42444e8fa2n>>128n),t>0&&(n=((1n<<256n)-1n)/n),(n>>32n)+(n%(1n<<32n)===0n?0n:1n)}function it(t,e,n,a){if(a<=0n)return{amount0:0n,amount1:0n};let[i,o]=e<n?[e,n]:[n,e];if(t<=i)return{amount0:(a<<96n)*(o-i)/o/i,amount1:0n};if(t<o){let s=(a<<96n)*(o-t)/o/t,u=a*(t-i)/Re;return{amount0:s,amount1:u}}return{amount0:0n,amount1:a*(o-i)/Re}}async function C(t,e,n,a){let i=l(e),o,r;if(n===k&&i===f.weth?(o=18,r="WETH"):n===k&&i===f.usdg&&(o=6,r="USDG"),o===void 0){let s=await t.readContract({address:i,abi:ye,functionName:"decimals"});o=Number(s)}if(r===void 0)try{let s=await t.readContract({address:i,abi:ye,functionName:"symbol"});if(typeof s!="string"||!s.trim())throw new c("Token symbol is unavailable.");r=Ne(s.trim(),i)}catch(s){throw new c(`Could not read token metadata. ${T(s)}`)}if(!Number.isInteger(o)||o<0||o>255)throw new c("Token decimals are invalid.");if(a!=null){let s=Number(a);if(!Number.isInteger(s)||s!==o)throw new c(`Token ${i} on chain ${n} has ${o} decimals, not ${String(a)}.`)}return{address:i,symbol:r,decimals:o,chainId:n}}async function ot(t){try{if(!t.getBlock)throw new c("Block timestamps are unavailable.");let e=await t.getBlock();if(typeof e.timestamp!="bigint")throw new c("Invalid block timestamp.");return e.timestamp}catch(e){throw new c(`Could not read the current block timestamp. ${T(e)}`)}}function J(t,e){if(typeof t=="bigint"){if(t<0n)throw new c(`${e} must be a non-negative integer.`);return t}if(typeof t=="number"){if(!Number.isSafeInteger(t)||t<0)throw new c(`${e} must be a non-negative integer.`);return BigInt(t)}if(typeof t=="string")return W(t);throw new c(`${e} must be a non-negative integer.`)}async function Ee(t,e){let n=await ot(t);if(e==null)return n+Qe;let a=J(e,"deadline");if(a<=n)throw new c(`Uniswap v3 deadline (${a.toString()}) has expired at timestamp ${n.toString()}.`);return a}function V(t,e){if(typeof t!="string"||!/^\d+$/.test(t))throw new c(`${e} must be a non-negative integer string in base units.`);return W(t)}function Be(t){let e=t.slippageBps??ne;if(typeof e!="number")throw new c("Slippage must be an integer from 0 to 9999 bps.");return ge("0",e),e}function ae(t,e,n,a){let i=t===void 0?W(ge(e.toString(),n)):V(t,a);if(i<=1n)throw new c(`${a} must exceed 1 base unit; the simulated amount may be too small.`);return i}function X(t,e){return me({to:f.positionManager,data:t,value:"0",chainId:k,description:e})}async function Y(t,e,n){try{if(!t.request)throw new c("Sequential transaction simulation is unavailable.");let i=await t.request({method:"eth_simulateV1",params:[{blockStateCalls:[{calls:e.map(o=>({from:n,gas:`0x${Ue.toString(16)}`,to:o.to,data:o.data,value:`0x${BigInt(o.value).toString(16)}`}))}],validation:!1,traceTransfers:!0},"latest"]},{retryCount:0});if(!Array.isArray(i)||i.length!==1||!Array.isArray(i[0]?.calls)||i[0].calls.length!==e.length)throw new c("Unexpected batch simulation response.");return i[0].calls.map((o,r)=>{if(o.status!=="0x1"||o.error||typeof o.returnData!="string"||!/^0x([a-fA-F0-9]{2})*$/.test(o.returnData))throw new c(`Simulation call ${r+1} failed. ${T(o.error)}`);return o.returnData})}catch(a){throw new c(`Uniswap v3 simulation failed. ${T(a)}`)}}function ce(t,e){try{return he({abi:v,functionName:t,data:e})}catch{throw new c(`Uniswap v3 ${t} simulation returned invalid amounts.`)}}function De(t,e,n){if(t.initialPrice!==void 0&&t.sqrtPriceX96!==void 0)throw new c("Provide initialPrice or sqrtPriceX96, not both.");if(t.sqrtPriceX96!==void 0){if(typeof t.sqrtPriceX96!="string"||!/^\d+$/.test(t.sqrtPriceX96))throw new c("sqrtPriceX96 must be a non-negative integer string.");return Ce(BigInt(t.sqrtPriceX96))}if(t.initialPrice===void 0)throw new c("A new pool needs initialPrice (token1 per 1 token0, human units) or sqrtPriceX96.");return Me(t.initialPrice,e,n)}async function Oe(t,e,n,a){let i=[];for(let o of Object.keys(ve).map(Number)){if(o===a)continue;let r=l(String(await t.readContract({address:f.factory,abi:Q,functionName:"getPool",args:[e,n,o]})));if(r===M||BigInt(await t.readContract({address:r,abi:ke,functionName:"liquidity"}))===0n)continue;let u=await t.readContract({address:r,abi:ke,functionName:"slot0"});i.push({label:`v3 fee ${o} pool ${r}`,sqrtPriceX96:BigInt(u[0])})}return i}function G(t,e={}){if(e.chainId!==void 0&&Number(e.chainId)!==k)throw new c(`Uniswap v3 is only supported on Robinhood Chain (${k}).`);if(e.version!==void 0&&e.version!=="v3")throw new c(`Uniswap v3 handler received unsupported version "${String(e.version)}".`);let n=t.clientFor(k);return{...n,readContract:async a=>{try{return await n.readContract(a)}catch(i){throw new c(`Could not read Uniswap v3 ${a.functionName}. ${T(i)}`,{cause:i})}}}}async function xe(t,e,n){let a;try{a=await t.readContract({address:f.positionManager,abi:v,functionName:"ownerOf",args:[e]})}catch(r){throw new c(`Could not verify owner of Uniswap v3 position #${e}. ${T(r)}`)}let i=l(String(a)),o=l(n);if(i!==o)throw new c(`Wallet ${o} is not the owner of Uniswap v3 position #${e.toString()} (owned by ${i}).`);return i}async function de(t,e){let n=await t.readContract({address:f.positionManager,abi:v,functionName:"positions",args:[e]});return nt(n)}function Ie(t,e){if(!Array.isArray(e.changes)||!e.changes.length)return t;let n=e.changes.map(a=>`${tt(a.amount,a.token.decimals)} ${a.token.symbol}`);return`${t} (${n.join(", ")})`}async function rt(t,e,n){O(n);let a=l(n),i=G(t,e),o=await Ee(i,e.deadline),r=Be(e),s=e.tokenId===void 0?void 0:J(e.tokenId,"tokenId"),u;if(s!==void 0){if(s<=0n)throw new c("Uniswap v3 tokenId must be a positive integer.");await xe(i,s,a),u=await de(i,s)}let d=u?.token0??E(e.token0,"token0"),p=u?.token1??E(e.token1,"token1");if(BigInt(d)>=BigInt(p))throw new c("Uniswap v3 requires distinct sorted token addresses.");let m=u?.fee??Number(e.fee??100),g=ve[m];if(!g)throw new c("Unsupported Uniswap v3 fee tier.");let y=l(String(await i.readContract({address:f.factory,abi:Q,functionName:"getPool",args:[d,p,m]}))),h=e.initialPrice!==void 0||e.sqrtPriceX96!==void 0;if(y===M&&!h)throw new c("No Uniswap v3 pool exists for these tokens and fee tier. To create it and add the first liquidity in one tool call with separately confirmed transactions, add initialPrice (token1 per 1 token0, human units) to this call; to create it without liquidity use uniswap_create_pool.");if(y!==M&&h)throw new c(`The Uniswap v3 pool already exists at ${y}; remove initialPrice/sqrtPriceX96 to add liquidity at its current price.`);if(s!==void 0&&h)throw new c("initialPrice cannot be combined with tokenId.");if(e.fullRange!==void 0&&typeof e.fullRange!="boolean")throw new c("fullRange must be a boolean.");if(e.fullRange===!0&&(e.tickLower!==void 0||e.tickUpper!==void 0||u))throw new c("Use fullRange only for a new position, without explicit ticks. Existing position ticks cannot change.");let{tickLower:S,tickUpper:N,tickSpacing:U}=et(u?.tickLower??(e.fullRange===!0?Math.ceil(re/g)*g:e.tickLower),u?.tickUpper??(e.fullRange===!0?Math.floor(se/g)*g:e.tickUpper),g),w=await C(i,d,k,e.token0Decimals),b=await C(i,p,k,e.token1Decimals),P;if(y===M){let q=De(e,w.decimals,b.decimals),L=be(q,await Oe(i,d,p,m),e.acceptPriceDeviation===!0,w.decimals,b.decimals);P={sqrtPriceX96:q,note:L}}let x=V(e.amount0Desired,"amount0Desired"),I=V(e.amount1Desired,"amount1Desired");if(x===0n&&I===0n)throw new c("Liquidity addition requires a positive desired amount.");let $=e.recipient===void 0?a:E(e.recipient,"recipient");if($!==a)throw new c("Uniswap recipient must be the signing wallet.");if(e.wrapNative===!0&&d!==f.weth&&p!==f.weth)throw new c("Wrapping requires a positive WETH desired amount.");let H=await Promise.all([d,p].map(async q=>BigInt(await i.readContract({address:q,abi:ye,functionName:"allowance",args:[a,f.positionManager]})))),j=(q,L)=>{let pe=[];if(e.wrapNative===!0){let K=d===f.weth?q:L;K>0n&&pe.push(me({to:f.weth,data:Ze,value:K.toString(),chainId:k,description:"Wrap ETH into WETH."}))}for(let[K,We]of[d,p].entries()){let fe=K===0?q:L;fe>0n&&H[K]<fe&&pe.push(t.approval(We,f.positionManager,fe.toString(),k))}return pe},F=s===void 0?"mint":"increaseLiquidity",B=(q,L)=>X(s===void 0?R({abi:v,functionName:"mint",args:[{token0:d,token1:p,fee:m,tickLower:S,tickUpper:N,amount0Desired:x,amount1Desired:I,amount0Min:q,amount1Min:L,recipient:$,deadline:o}]}):R({abi:v,functionName:"increaseLiquidity",args:[{tokenId:s,amount0Desired:x,amount1Desired:I,amount0Min:q,amount1Min:L,deadline:o}]}),`${F==="mint"?"Mint":"Increase"} Uniswap v3 ${w.symbol}/${b.symbol} liquidity.`),D=P&&X(R({abi:v,functionName:"createAndInitializePoolIfNecessary",args:[d,p,m,P.sqrtPriceX96]}),`Create and initialize the Uniswap v3 ${w.symbol}/${b.symbol} fee ${m} pool at ${ie(P.sqrtPriceX96,w.decimals,b.decimals)} ${b.symbol} per ${w.symbol}.`),Pe=D?[D]:[],Se=await Y(i,[...Pe,...j(x,I),B(0n,0n)],a),A=ce(F,Se[Se.length-1]),He=A[A.length-2],Fe=A[A.length-1];if(He>x||Fe>I)throw new c("Simulated liquidity spend exceeds the desired amounts.");let ee=[...Pe,...j(x,I)],ue=ae(e.amount0Min,A[A.length-2],r,"amount0Min"),le=ae(e.amount1Min,A[A.length-1],r,"amount1Min");if(ue>x||le>I)throw new c("Uniswap v3 minimum amount cannot exceed desired amount.");let Ae=B(ue,le);ee.push(Ae);for(let[q,L]of[d,p].entries())(q===0?x:I)>0n&&ee.push(t.approval(L,f.positionManager,"0",k));let qe=await t.preview(ee,a);return{txs:ee,preview:qe,summary:Ie(Ae.description,qe),details:{version:"v3",action:F,...s===void 0?{}:{tokenId:s.toString()},pool:y===M?null:y,fee:m,tickSpacing:U,tickLower:S,tickUpper:N,token0:w,token1:b,amount0Desired:x.toString(),amount1Desired:I.toString(),amount0Min:ue.toString(),amount1Min:le.toString(),deadline:o.toString(),recipient:$,expectedAmount0:A[A.length-2].toString(),expectedAmount1:A[A.length-1].toString(),...P?{poolCreated:!0,sqrtPriceX96:P.sqrtPriceX96.toString(),initialPrice:ie(P.sqrtPriceX96,w.decimals,b.decimals),initialTick:we(P.sqrtPriceX96),priceCheck:P.note}:{}}}}async function st(t,e,n){O(n);let a=l(n),i=G(t,e),o=E(e.token0,"token0"),r=E(e.token1,"token1");if(BigInt(o)>=BigInt(r))throw new c(`Uniswap v3 requires sorted token addresses (token0 < token1). Use token0=${BigInt(o)<BigInt(r)?o:r}, token1=${BigInt(o)<BigInt(r)?r:o}; initialPrice is token1 per 1 token0 in that order.`);let s=Number(e.fee),u=ve[s];if(!u){let b=Number(await i.readContract({address:f.factory,abi:Q,functionName:"feeAmountTickSpacing",args:[s]}));if(!Number.isInteger(s)||b<=0)throw new c("Unsupported Uniswap v3 fee tier. Enabled tiers: 100, 500, 3000, 10000.");u=b}let d=l(String(await i.readContract({address:f.factory,abi:Q,functionName:"getPool",args:[o,r,s]})));if(d!==M)throw new c(`The Uniswap v3 pool already exists at ${d}. Use uniswap_add to provide liquidity.`);let p=await C(i,o,k,e.token0Decimals),m=await C(i,r,k,e.token1Decimals),g=De(e,p.decimals,m.decimals),y=be(g,await Oe(i,o,r,s),e.acceptPriceDeviation===!0,p.decimals,m.decimals),h=ie(g,p.decimals,m.decimals),S=[X(R({abi:v,functionName:"createAndInitializePoolIfNecessary",args:[o,r,s,g]}),`Create and initialize the Uniswap v3 ${p.symbol}/${m.symbol} fee ${s} pool at ${h} ${m.symbol} per ${p.symbol}.`)],N=await Y(i,S,a),U;try{U=l(String(he({abi:v,functionName:"createAndInitializePoolIfNecessary",data:N[0]})))}catch{throw new c("Uniswap v3 pool creation simulation returned an invalid pool address.")}if(U===M)throw new c("Uniswap v3 pool creation simulation returned no pool.");let w=await t.preview(S,a);return{txs:S,preview:w,summary:`${S[0].description} The pool starts empty: nothing trades until liquidity is added with uniswap_add.`,details:{version:"v3",action:"createPool",pool:U,fee:s,tickSpacing:u,token0:p,token1:m,sqrtPriceX96:g.toString(),initialPrice:h,initialTick:we(g),priceCheck:y}}}async function at(t,e,n){O(n);let a=l(n),i=G(t,e),o=J(e.tokenId,"tokenId");if(o<=0n)throw new c("Uniswap v3 tokenId must be a positive integer.");await xe(i,o,a);let r=await de(i,o),s=await C(i,r.token0,k),u=await C(i,r.token1,k),d=e.recipient===void 0?a:E(e.recipient,"recipient");if(d!==a)throw new c("Uniswap recipient must be the signing wallet.");let p=e.amount0Max===void 0?z:V(e.amount0Max,"amount0Max"),m=e.amount1Max===void 0?z:V(e.amount1Max,"amount1Max");if(p===0n&&m===0n||p>z||m>z)throw new c("Collect requires a positive amountMax within uint128.");let g=[X(R({abi:v,functionName:"collect",args:[{tokenId:o,recipient:d,amount0Max:p,amount1Max:m}]}),`Collect Uniswap v3 fees from position #${o}.`)],y=ce("collect",(await Y(i,g,a))[0]),h=await t.preview(g,a);return{txs:g,preview:h,summary:Ie(g[0].description,h),details:{version:"v3",action:"collect",tokenId:o.toString(),recipient:d,token0:s,token1:u,amount0Max:p.toString(),amount1Max:m.toString(),expectedAmount0:y[0].toString(),expectedAmount1:y[1].toString()}}}async function ct(t,e,n){O(n);let a=l(n),i=G(t,e),o=J(e.tokenId,"tokenId");if(o<=0n)throw new c("Uniswap v3 tokenId must be a positive integer.");await xe(i,o,a);let r=await de(i,o),s=r.liquidity===0n&&e.burn===!0;if(r.liquidity<=0n&&!s)throw new c("Position has zero active liquidity to remove.");if(e.liquidity===void 0&&!s)throw new c('Provide a liquidity amount or explicitly choose liquidity "all" for a full exit.');let u=e.liquidity==="all"||e.liquidity===void 0?r.liquidity:V(e.liquidity,"liquidity");if(u<=0n&&!s)throw new c("Liquidity to remove must be positive.");if(u>r.liquidity)throw new c("Requested liquidity exceeds position liquidity.");let d=await Ee(i,e.deadline),p=Be(e),m=await C(i,r.token0,k),g=await C(i,r.token1,k),y=e.recipient===void 0?a:E(e.recipient,"recipient");if(y!==a)throw new c("Uniswap recipient must be the signing wallet.");let h=(B,D)=>X(R({abi:v,functionName:"decreaseLiquidity",args:[{tokenId:o,liquidity:u,amount0Min:B,amount1Min:D,deadline:d}]}),`Decrease ${u} liquidity on Uniswap v3 position #${o}.`),S=s?[0n,0n]:ce("decreaseLiquidity",(await Y(i,[h(0n,0n)],a))[0]),N=(B,D)=>{if(B!==void 0&&V(B,D)!==0n)throw new c(`${D} must be zero for an empty position burn.`);return 0n},U=s?N(e.amount0Min,"amount0Min"):ae(e.amount0Min,S[0],p,"amount0Min"),w=s?N(e.amount1Min,"amount1Min"):ae(e.amount1Min,S[1],p,"amount1Min"),b=s?[]:[h(U,w)],P=b.length,x=!s||r.tokensOwed0>0n||r.tokensOwed1>0n;x&&b.push(X(R({abi:v,functionName:"collect",args:[{tokenId:o,recipient:y,amount0Max:z,amount1Max:z}]}),`Collect principal and fees from Uniswap v3 position #${o}.`));let I=u===r.liquidity,$=I&&e.burn===!0;$&&b.push(X(R({abi:v,functionName:"burn",args:[o]}),`Burn empty Uniswap v3 position #${o}.`));let H=await Y(i,b,a),j=x?ce("collect",H[P]):[0n,0n],F=await t.preview(b,a);return{txs:b,preview:F,summary:Ie(`Remove Uniswap v3 liquidity from position #${o}${$?`; burns position #${o} at ${f.positionManager}`:""}`,F),details:{version:"v3",action:"remove",tokenId:o.toString(),recipient:y,token0:m,token1:g,liquidityRemoved:u.toString(),amount0Min:U.toString(),amount1Min:w.toString(),deadline:d.toString(),expectedAmount0:j[0].toString(),expectedAmount1:j[1].toString(),fullExit:I,burned:$}}}async function dt(t,e,n={}){let a=l(e),i=new Set;if(Array.isArray(n.tokenIds))for(let r of n.tokenIds){let s=J(r,"tokenId");s>0n&&i.add(s.toString())}if(Array.isArray(n.receipts))for(let r of n.receipts)for(let s of Le(r,a))i.add(s);if(Array.isArray(n.tokenIds)&&n.tokenIds.length>0)return[...i].map(r=>BigInt(r)).sort((r,s)=>r<s?-1:r>s?1:0);let o=!1;try{let r=BigInt(await t.readContract({address:f.positionManager,abi:v,functionName:"balanceOf",args:[a]})),s=r>$e?$e:r;r>s&&n.onTruncated?.(r,s);for(let u=0n;u<s;u++){try{let d=BigInt(await t.readContract({address:f.positionManager,abi:v,functionName:"tokenOfOwnerByIndex",args:[a,u]}));d>0n&&i.add(d.toString())}catch(d){if(!te(d,3,-32601,-32004))throw d;break}u+1n===r&&(o=!0)}r===0n&&(o=!0)}catch(r){if(!te(r,3,-32601,-32004))throw r}if(typeof t.getLogs=="function"&&typeof t.getBlockNumber=="function")try{let r=n.toBlock??await t.getBlockNumber(),s=n.maxChunks??Ke,u=n.fromBlock??(r>oe*BigInt(s)?r-oe*BigInt(s)+1n:0n),d=r,p=0;for(;d>=u&&p<s;){let m=d>=oe-1n?d-(oe-1n):0n,g=m<u?u:m,y=await t.getLogs({address:f.positionManager,fromBlock:g,toBlock:d});for(let h of Le({logs:y},a))i.add(h);if(p+=1,g===0n||g<=u)break;d=g-1n}}catch(r){throw new c(`Could not discover Uniswap v3 positions from logs. ${T(r)}`)}else if(!o&&n.tokenIds===void 0&&n.receipts===void 0)throw new c("Uniswap v3 position discovery is unavailable; supply candidate token IDs or receipts.");return[...i].map(r=>BigInt(r)).sort((r,s)=>r<s?-1:r>s?1:0)}async function Xe(t,e,n={}){O(e);let a=l(e),i=G(t),o=await dt(i,a,n),r=[];for(let s of o){let u;try{let w=await i.readContract({address:f.positionManager,abi:v,functionName:"ownerOf",args:[s]});u=l(String(w))}catch(w){if(te(w,3))continue;throw new c(`Could not verify owner of position #${s}. ${T(w)}`)}if(u!==a)continue;let d;try{d=await de(i,s)}catch(w){throw new c(`Could not read position #${s}. ${T(w)}`)}if(d.liquidity===0n&&d.tokensOwed0===0n&&d.tokensOwed1===0n&&!n.includeEmpty)continue;let m=await C(i,d.token0,k),g=await C(i,d.token1,k),y=0n,h=0n;if(d.liquidity>0n)try{let w=await i.readContract({address:f.factory,abi:Q,functionName:"getPool",args:[d.token0,d.token1,d.fee]}),b=l(String(w));if(b===M)throw new c("Position pool was not found.");if(b!==M){let P=await i.readContract({address:b,abi:ke,functionName:"slot0"}),x=BigInt(P[0]);if(x<=0n)throw new c("Position pool has no initialized price.");let I=_e(d.tickLower),$=_e(d.tickUpper),H=it(x,I,$,d.liquidity);y=H.amount0,h=H.amount1}}catch(w){throw new c(`Could not value Uniswap v3 position #${s}. ${T(w)}`)}let S=y+d.tokensOwed0,N=h+d.tokensOwed1,U=[{token:m,amount:S.toString()},{token:g,amount:N.toString()}];r.push({module:"uniswap",id:`uniswap:v3:${s.toString()}`,chainId:k,assets:U,description:`Uniswap v3 LP position #${s.toString()} (${m.symbol}/${g.symbol} fee ${d.fee} ticks [${d.tickLower}, ${d.tickUpper}] liquidity ${d.liquidity.toString()})`})}return r}async function ut(t,e,n){G(t,e);let a=e.wallet!==void 0?E(e.wallet,"wallet"):l(n),i=Array.isArray(e.tokenIds)?e.tokenIds:void 0,o=Array.isArray(e.receipts)?e.receipts:void 0,r=e.includeZero===!0||e.includeEmpty===!0,s,u=await Xe(t,a,{tokenIds:i,receipts:o,includeEmpty:r,onTruncated:(d,p)=>{s={balance:d,listed:p}}});return{positions:u,details:{version:"v3",wallet:a,count:u.length,positionManager:f.positionManager,...s?{truncated:!0,incomplete:!0,note:`This wallet holds ${s.balance} Uniswap v3 position NFTs and only the first ${s.listed} were checked, so later positions are not listed. Pass tokenIds to check specific positions.`}:{}}}}function lt(t){return[{name:"uniswap_add",inputSchema:{type:"object",description:"Mint a new Uniswap v3 concentrated liquidity position or increase liquidity on an existing v3 NFT position on Robinhood Chain (4663).",properties:{version:{type:"string",enum:["v3"],default:"v3"},tokenId:{type:"string",description:"Optional existing v3 NFT tokenId for increaseLiquidity."},token0:{type:"string",description:"Sorted ERC-20 token0 address (e.g. WETH)."},token1:{type:"string",description:"Sorted ERC-20 token1 address (e.g. USDG)."},fee:{type:"integer",enum:[100,500,3e3,1e4],default:100},fullRange:{type:"boolean",description:"For a new v3 position, use the widest ticks aligned to the pool fee tier; omit explicit ticks."},tickLower:{type:"integer",description:"Lower tick boundary divisible by tickSpacing."},tickUpper:{type:"integer",description:"Upper tick boundary divisible by tickSpacing."},amount0Desired:{type:"string",description:"Desired token0 amount in decimal base units."},amount1Desired:{type:"string",description:"Desired token1 amount in decimal base units."},amount0Min:{type:"string",description:"Minimum token0 amount in decimal base units."},amount1Min:{type:"string",description:"Minimum token1 amount in decimal base units."},slippageBps:{type:"integer",minimum:0,maximum:9999,default:ne},deadline:{type:"integer",description:"Unix timestamp deadline (> current block timestamp)."},wrapNative:{type:"boolean",description:"Optional: wrap native ETH into WETH before minting."},initialPrice:{type:"string",description:"Only when the pool does not exist: starting price as token1 per 1 token0 in human units. The pool is created then liquidity is minted in separately confirmed transactions."},sqrtPriceX96:{type:"string",description:"Alternative to initialPrice: exact starting sqrtPriceX96."},acceptPriceDeviation:{type:"boolean",description:"Allow a starting price more than 500 bps from other live pools of the pair."}}},execute:(r,s)=>rt(t,r,s)},{name:"uniswap_collect",inputSchema:{type:"object",description:"Collect accrued Uniswap v3 LP fees for an owned NonfungiblePositionManager NFT.",properties:{version:{type:"string",enum:["v3"],default:"v3"},tokenId:{type:"string",description:"Uniswap v3 NFT tokenId."},recipient:{type:"string",description:"Optional fee recipient; must be the signing wallet."},amount0Max:{type:"string",description:"Max token0 to collect (defaults to uint128 max)."},amount1Max:{type:"string",description:"Max token1 to collect (defaults to uint128 max)."}},required:["tokenId"]},execute:(r,s)=>at(t,r,s)},{name:"uniswap_remove",inputSchema:{type:"object",description:"Decrease liquidity on an owned Uniswap v3 NFT position, collect principal and fees, and optionally burn the empty NFT.",properties:{version:{type:"string",enum:["v3"],default:"v3"},tokenId:{type:"string",description:"Uniswap v3 NFT tokenId."},liquidity:{type:"string",description:"Positive base-unit liquidity amount, or all for a full exit."},amount0Min:{type:"string",description:"Minimum token0 principal in decimal base units."},amount1Min:{type:"string",description:"Minimum token1 principal in decimal base units."},slippageBps:{type:"integer",minimum:0,maximum:9999,default:ne},deadline:{type:"integer",description:"Unix timestamp deadline (> current block timestamp)."},burn:{type:"boolean",description:"Whether to burn the NFT after removing 100% of liquidity, or burn an already-empty position."}},required:["tokenId"]},execute:(r,s)=>ct(t,r,s)},{name:"uniswap_list_positions",inputSchema:{type:"object",description:"List active Uniswap v3 LP positions owned by the wallet from NFT receipts and Transfer logs.",properties:{version:{type:"string",enum:["v3"],default:"v3"},wallet:{type:"string",description:"Optional wallet address override."},tokenIds:{type:"array",items:{type:"string"},description:"Optional candidate v3 NFT tokenIds to inspect."}}},execute:(r,s)=>ut(t,r,s)},{name:"uniswap_create_pool",inputSchema:{type:"object",description:"Create and initialize an empty Uniswap v3 pool on Robinhood Chain (4663). Add liquidity afterwards with uniswap_add.",properties:{version:{type:"string",enum:["v3"],default:"v3"},token0:{type:"string",description:"Sorted ERC-20 token0 address (WETH, not native ETH)."},token1:{type:"string",description:"Sorted ERC-20 token1 address."},fee:{type:"integer",enum:[100,500,3e3,1e4]},initialPrice:{type:"string",description:'Starting price as token1 per 1 token0 in human units, e.g. "3000" for 1 WETH = 3000 USDG.'},sqrtPriceX96:{type:"string",description:"Alternative to initialPrice: exact starting sqrtPriceX96."},acceptPriceDeviation:{type:"boolean",description:"Allow a starting price more than 500 bps from other live pools of the pair."}},required:["token0","token1","fee"]},execute:(r,s)=>st(t,r,s)}]}var Ve=t=>({tools:lt(t),positions:async e=>{let n,a=await Xe(t,e,{onTruncated:(i,o)=>{n={module:"uniswap",id:"uniswap-v3-discovery-truncated",chainId:k,assets:[],incomplete:!0,description:`This wallet holds ${i} Uniswap v3 position NFTs and only the first ${o} were checked, so later positions may be missing. Pass tokenIds to uniswap_list_positions to check the others.`}}});return n?[...a,n]:a}}),xt=Ve,It=Ve;export{re as a,se as b,z as c,f as d,ve as e,ht as f,v as g,Q as h,ke as i,Ye as j,et as k,tt as l,nt as m,Le as n,vt as o,De as p,rt as q,st as r,at as s,ct as t,Xe as u,ut as v,lt as w,Ve as x,xt as y,It as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as t}from"./W2OJ57ZO.js";import{c as o}from"./65EQECL3.js";function s(e,n,a){return t(e,n,a,o)}export{s as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as pe,c as De}from"./ZBFKKUNP.js";import{c as Te,d as a,r as xe}from"./6PY3IRDS.js";import{o as ce}from"./GHPREYQK.js";import{a as M}from"./HTXKERNS.js";import{a as ve}from"./PBQSJSZO.js";import{a as te}from"./5ZLOCQA4.js";import{c as H,j as Ce}from"./5KUWLUPM.js";import{a as ke}from"./UP7FBDMJ.js";import{a as R,i as qe}from"./FWD4L3CJ.js";import{a as e}from"./XSD5NL7J.js";import{decodeFunctionData as Ee,erc20Abi as Ne}from"viem";var je="https://api.relay.link",q="0x0000000000000000000000000000000000000000",Le=60,Se=30,n=qe[R].relay.depository.address.toLowerCase(),ne="0x59916da825d2d2ec1bf878d71c88826f6633ecca",Oe=new Map([[1,{chainId:"ethereum",depository:n}],[10,{chainId:"optimism",depository:n}],[25,{chainId:"cronos",depository:ne}],[56,{chainId:"bnb",depository:n}],[100,{chainId:"gnosis",depository:n}],[130,{chainId:"unichain",depository:n}],[137,{chainId:"polygon",depository:n}],[143,{chainId:"monad",depository:n}],[146,{chainId:"sonic",depository:n}],[169,{chainId:"manta",depository:n}],[196,{chainId:"xlayer",depository:n}],[288,{chainId:"boba",depository:n}],[324,{chainId:"zksync",depository:n}],[360,{chainId:"shape",depository:n}],[480,{chainId:"worldchain",depository:n}],[747,{chainId:"flow",depository:n}],[988,{chainId:"stable",depository:n}],[999,{chainId:"hyperevm",depository:n}],[1088,{chainId:"metis",depository:ne}],[1135,{chainId:"lisk",depository:n}],[1868,{chainId:"soneium",depository:n}],[2020,{chainId:"ronin",depository:n}],[2741,{chainId:"abstract",depository:n}],[2818,{chainId:"morph",depository:n}],[4217,{chainId:"tempo",depository:n}],[4326,{chainId:"megaeth",depository:n}],[5e3,{chainId:"mantle",depository:ne}],[5031,{chainId:"somnia",depository:n}],[5042,{chainId:"arc",depository:n}],[8453,{chainId:"base",depository:n}],[9745,{chainId:"plasma",depository:n}],[33139,{chainId:"apechain",depository:n}],[34443,{chainId:"mode",depository:n}],[42018,{chainId:"mythos",depository:n}],[42161,{chainId:"arbitrum",depository:n}],[42220,{chainId:"celo",depository:n}],[43114,{chainId:"avalanche",depository:n}],[48900,{chainId:"zircuit",depository:n}],[57073,{chainId:"ink",depository:n}],[59144,{chainId:"linea",depository:ne}],[60808,{chainId:"bob",depository:n}],[80094,{chainId:"berachain",depository:n}],[97477,{chainId:"doma",depository:n}],[98866,{chainId:"plume",depository:n}],[534352,{chainId:"scroll",depository:n}],[685689,{chainId:"gensyn",depository:n}],[747474,{chainId:"katana",depository:n}],[5064014,{chainId:"ethereal",depository:n}],[7777777,{chainId:"zora",depository:n}]]);function nt(t){return Oe.get(t)?.depository}function F(t){return Ce(t,"Provide a token or wallet address.")}function I(t){let o=F(t);return o===M?q:o}function f(t,o){return F(t)===F(o)}function l(t){if(typeof t!="string")throw new e("Provide a decimal base-unit amount string.");return ke(t),t}function oe(t){let o=l(t);if(BigInt(o)<=0n)throw new e("Provide a positive base-unit amount.");return o}function ze(t){if(typeof t!="number"||!Number.isSafeInteger(t)||t<=0)throw new e("Provide a positive integer origin chain ID.");return t}function Pe(t,o){if(typeof t!="number"||!Number.isSafeInteger(t)||t<=0)throw new e(`${o} is missing or invalid.`);return t}async function G(t,o,c,i,p){let r=a(c);if(r.chainId!==i||I(r.address)!==p||typeof r.symbol!="string"||!/^[A-Za-z0-9._-]{1,32}$/.test(r.symbol))throw new e("Relay quote token metadata does not match the requested chain and address.");if(p===q){if(r.decimals!==18)throw new e("Native token decimals must be 18.");return{address:M,chainId:i,symbol:r.symbol,decimals:18}}let g=`${i}:${p}`,m=o.get(g);if(m===void 0){let d=await t.clientFor(i).readContract({address:p,abi:Ne,functionName:"decimals"}),w=typeof d=="bigint"?Number(d):d;if(typeof w!="number"||!Number.isInteger(w)||w<0||w>255)throw new e("Could not read valid ERC-20 decimals() on-chain.");m=w,o.set(g,m)}return{address:p,chainId:i,symbol:r.symbol,decimals:m}}async function Ke(t,o,c,i,p,r,g){if(c.swap===void 0)return[];let m=a(c.swap),d=a(m.from);if(d.chainId!==p)throw new e("The swap prerequisite token must be on the origin chain.");let w=await G(t,o,d,p,I(d.address)),j=r===q?M:r;if(f(w.address,j))throw new e("The swap prerequisite must use a different input token.");let me=oe(m.amountIn),y=m.slippageBps;if(y!==void 0&&(typeof y!="number"||!Number.isInteger(y)||y<0||y>1e4))throw new e("Provide swap slippage in basis points from 0 to 10000.");let E=await t.quoteSwap({from:w.address,to:j,amountIn:me,...y===void 0?{}:{slippageBps:y}},i);if(BigInt(l(E.expiresAt))<=BigInt(Math.floor(Date.now()/1e3)))throw new e("The swap prerequisite quote expired. Request a fresh quote.");if(BigInt(l(E.minAmountOut))<BigInt(g))throw new e("The swap prerequisite minimum cannot cover the bridge amount.");let k=await t.buildSwap(E.quoteId,i);if(!("txs"in k)||!k.txs.length)throw new e("The swap prerequisite must return unsigned transactions.");if(k.txs.some(S=>S.chainId!==p))throw new e("The injected swap coordinator does not support this origin chain.");return k.txs.map(S=>t.unsignedTx(S))}async function Ue(t,o,c){ve(c);let i=ze(o.originChainId);if(i===R)throw new e("Inbound bridging requires an origin chain other than 4663.");let p=Oe.get(i);if(!p)throw new e("Relay inbound does not support this origin chain.");if(o.destinationChainId!==void 0&&o.destinationChainId!==R)throw new e("Inbound bridge destination must be chain 4663.");let r=I(o.originCurrency??M),g=I(o.destinationCurrency??M),m=F(o.recipient??c),d=oe(o.amount),w=o.minAmountOut===void 0?void 0:l(o.minAmountOut),j=o.slippageBps===void 0?pe:o.slippageBps;if(ce("0",j),await t.clientFor(i).getChainId()!==i)throw new e("The RPC chain does not match the inbound origin chain.");let y=new Map,E=await Ke(t,y,o,c,i,r,d),k,S=process.env.OAK_RELAY_API_KEY?.trim();if(!S)throw new e("Configure OAK_RELAY_API_KEY on the server: Relay quote/v2 requires a valid API key since October 2, 2026. Status and chain reads remain available without it.");try{let s=await t.http(`${je}/quote/v2`,{method:"POST",headers:{"content-type":"application/json","user-agent":"oak-core/0.1.0","x-api-key":S},body:JSON.stringify({user:c,recipient:m,originChainId:i,destinationChainId:R,originCurrency:r,destinationCurrency:g,amount:d,tradeType:"EXACT_INPUT",...r===q?{}:{explicitDeposit:!0}})});if(!s.ok)throw new Error("Relay HTTP failure.");k=await s.json()}catch{throw new e("Relay quote request failed. Please try again.")}let b=a(k);if(typeof b.requestId!="string"||!/^0x[0-9a-fA-F]{64}$/.test(b.requestId))throw new e("Relay returned an invalid request ID.");let P=b.requestId,he=`/intents/status/v3?requestId=${P}`,L=a(b.details);if(!f(L.sender,c)||!f(L.recipient,m))throw new e("Relay quote sender or recipient does not match the request.");let ye=a(L.currencyIn),ie=a(L.currencyOut),N=await G(t,y,ye.currency,i,r),O=await G(t,y,ie.currency,R,g);if(l(ye.amount)!==d)throw new e("Relay quote input amount does not match the request.");let _=oe(ie.amount),C=oe(ie.minimumAmount);if(BigInt(C)>BigInt(_))throw new e("Relay quote minimum output exceeds the expected output.");if(w!==void 0){if(C!==w)throw new e("Relay order minimum must exactly match minAmountOut. Request a new quote.")}else{let s=ce(_,j);if(BigInt(C)<BigInt(s))throw De(_,C)}let le=a(a(b.fees).relayer),fe=a(le.currency),Q=await G(t,y,fe,i,I(fe.address)),we={token:Q,amount:l(le.amount)},Ie=a(L.refundCurrency),_e=a(Ie.currency),z=await G(t,y,_e,i,r),re=l(Ie.amount),K=a(a(b.protocol).v2);if(typeof K.orderId!="string"||!/^0x[0-9a-fA-F]{64}$/.test(K.orderId))throw new e("Relay returned an invalid order ID.");let V=K.orderId.toLowerCase(),W=a(K.paymentDetails),$=F(W.depository);if(W.chainId!==p.chainId||$!==p.depository||I(W.currency)!==r||l(W.amount)!==d)throw new e("Relay payment details do not match the origin chain depository and input.");let J=a(K.orderData),v=a(J.output);if(v.chainId!=="robinhood"||!Array.isArray(v.calls)||v.calls.length!==0||!Array.isArray(v.payments)||v.payments.length!==1)throw new e("Relay order output does not match destination chain 4663.");let X=a(v.payments[0]);if(!f(X.recipient,m)||I(X.currency)!==g||l(X.minimumAmount)!==C||l(X.expectedAmount)!==_)throw new e("Relay order output payment does not match the quoted recipient and amounts.");let se=Pe(v.deadline,"Relay order output deadline");if(!Array.isArray(J.inputs)||!J.inputs.length)throw new e("Relay order has no inputs.");let Z=[],ae=[];for(let s of J.inputs){let u=a(s),x=a(u.payment);if(x.chainId!==p.chainId||I(x.currency)!==r||l(x.amount)!==d||!Array.isArray(u.refunds)||!u.refunds.length)throw new e("Relay order input does not match the quoted input.");for(let D of u.refunds){let h=a(D);if(!f(h.recipient,c))throw new e("Relay refund recipient does not match the agent wallet. Request a new quote.");if(Z.push(Pe(h.deadline,"Relay order refund deadline")),ae.push(l(h.minimumAmount)),!(h.chainId===p.chainId?f(h.recipient,c)&&I(h.currency)===r:h.chainId==="robinhood"&&I(h.currency)===g))throw new e("Relay order refund terms do not match the sender or recipient.")}}let ge=Math.min(se,...Z),U=0,be=()=>{let s=Math.floor(Date.now()/1e3),u=U||s+Le;if(ge-s<=Se)throw new e("Relay order deadline is expired or too soon to sign safely. Request a new quote.");if(U=Math.min(u,ge-Se),U<=s)throw new e("Relay quote expired before signing. Request a new quote.")};if(be(),!Array.isArray(b.steps)||!b.steps.length)throw new e("Relay returned no origin transactions.");let T=[];for(let s of b.steps){let u=a(s);if(u.kind!=="transaction"||u.requestId!==P||!Array.isArray(u.items)||!u.items.length)throw new e("Relay returned an unsupported origin step.");for(let x of u.items){let D=a(x),h=a(D.data),ue=a(D.check);if(D.status!=="incomplete"||h.chainId!==i||!f(h.from,c))throw new e("Relay transaction does not match the origin chain and sender.");if(ue.method!=="GET"||ue.endpoint!==he)throw new e("Relay status endpoint does not match the request ID.");T.push(t.unsignedTx({to:F(h.to),data:h.data,value:l(h.value),chainId:i,description:`Relay inbound deposit for request ${P}; destination chain 4663.`}))}}if(!T.length)throw new e("Relay returned no origin transactions.");if(r===q&&T.length!==1)throw new e("Relay native deposit must be a single depositNative transaction.");if(r!==q&&T.length>2)throw new e("Relay ERC-20 deposit allows at most one exact-amount approval before depositErc20.");for(let s of T.slice(0,-1)){if(!s.data.toLowerCase().startsWith("0x095ea7b3"))throw new e("Relay returned an unsupported prerequisite transaction.");let u=Ee({abi:Ne,data:s.data});if(u.functionName!=="approve")throw new e("Relay returned an invalid approval.");let[x,D]=u.args;if(r===q||!f(s.to,r)||!f(x,$)||D!==BigInt(d)||s.value!=="0")throw new e("Relay approval must authorize the exact input amount for the origin depository.");s.description=`Approve exactly ${t.formatAmount(d,N.decimals)} ${N.symbol} (${d} base units of ${r}) for ${$} on chain ${i}.`}let B=T[T.length-1],Y=r===q,ee=Y?"depositNative":"depositErc20",Ae=Y?"depositNative(address,bytes32)":"depositErc20(address,address,uint256,bytes32)";if(!f(B.to,$)||B.value!==(Y?d:"0")||!(Y?/^0x[0-9a-fA-F]{136}$/:/^0x[0-9a-fA-F]{264}$/).test(B.data))throw new e(`Relay deposit transaction does not target the origin depository with ${ee} calldata.`);let A;try{A=Ee({abi:Te,data:B.data})}catch{throw new e(`Relay deposit transaction must call ${Ae}.`)}if(A.functionName!==ee)throw new e(`Relay deposit transaction must call ${Ae}.`);let Be=A.args[0],Me=A.functionName==="depositErc20"?A.args[3]:A.args[1];if(A.functionName==="depositErc20"&&(!f(A.args[1],r)||A.args[2]!==BigInt(d)))throw new e("Relay depositErc20 token or amount does not match the quoted input.");if(!f(Be,c)||Me.toLowerCase()!==V)throw new e(`Relay ${ee} depositor or orderId does not match the wallet and quoted protocol.v2.orderId.`);B.description=`Relay inbound ${ee} for order ${V} (request ${P}); destination chain 4663.`;let de=Y?[]:await xe(t,r,$,d,i,c);for(let[s,u]of de.entries())u.description=de.length===2&&s===0?`Reset the existing ${N.symbol} allowance for ${$} on chain ${i} to zero.`:`Approve exactly ${t.formatAmount(d,N.decimals)} ${N.symbol} (${d} base units of ${r}) for ${$} on chain ${i}.`;let $e=[...E,...de,B],Re=await t.preview($e,c);be();let Fe=Re.changes.map(s=>{let u=s.amount.startsWith("-");return`${u?"-":""}${t.formatAmount(u?s.amount.slice(1):s.amount,s.token.decimals)} ${s.token.symbol} (${s.token.address}, chain ${s.token.chainId})`});return{txs:$e,preview:Re,requestId:P,orderId:V,depository:$,originChainId:i,destinationChainId:R,recipient:m,amountIn:{token:N,amount:d},amountOut:{token:O,amount:_},minAmountOut:C,relayerFee:we,refundCurrency:{token:z,amount:re,minimumAmounts:ae},orderDeadline:String(se),refundDeadlines:Z.map(String),expiresAt:String(U),status:"pending",statusEndpoint:he,summary:`${E.length?"Swap prerequisite first, then ":""}Relay inbound from chain ${i} to chain 4663 for ${m}; expected ${t.formatAmount(_,O.decimals)} ${O.symbol}, minimum ${t.formatAmount(C,O.decimals)} ${O.symbol} (${O.address}). Quoted relay fee ${t.formatAmount(we.amount,Q.decimals)} ${Q.symbol} (${Q.address}, chain ${i}); output is net of quoted fees. Order ${V} (request ${P}); output deadline ${se}, refund deadlines ${Z.join(", ")}, quote expires ${U}. Refund terms: details.refundCurrency quotes ${t.formatAmount(re,z.decimals)} ${z.symbol} (${re} base units) on chain ${z.chainId} (${z.address}), but protocol.v2 order refund floor is ${ae.join(", ")} base units. ${Fe.join("; ")}. Unsigned origin transactions only; destination fulfillment remains pending. Track with relay_status; timeout or refund is not fulfillment.`}}var ot=t=>({tools:[{name:"relay_bridge_in",inputSchema:{type:"object",additionalProperties:!1,required:["originChainId","amount"],properties:{originChainId:{type:"integer",minimum:1},destinationChainId:{const:R},originCurrency:H,destinationCurrency:H,amount:te(),minAmountOut:te(),slippageBps:{type:"integer",minimum:0,maximum:9999,default:pe},recipient:H,swap:{type:"object",additionalProperties:!1,required:["from","amountIn"],properties:{from:{type:"object",additionalProperties:!1,required:["address","chainId","symbol","decimals"],properties:{address:H,chainId:{type:"integer",minimum:1},symbol:{type:"string"},decimals:{type:"integer",minimum:0,maximum:255}}},amountIn:te(),slippageBps:{type:"integer",minimum:0,maximum:1e4}}}}},async execute(o,c){try{return await Ue(t,o,c)}catch(i){throw new e(t.plainError(i))}}}]});export{nt as a,ot as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as q}from"./ALRRW7SF.js";import{b as S}from"./65EQECL3.js";import{b as le}from"./Z4SRGAVL.js";import{a as _}from"./PBQSJSZO.js";import{g as B,i as ue}from"./5KUWLUPM.js";import{a as H}from"./UP7FBDMJ.js";import{a as u,i as N}from"./FWD4L3CJ.js";import{a as c}from"./XSD5NL7J.js";import{a as ce}from"./JXOEJPJ4.js";import{encodeFunctionData as z,erc20Abi as me,getAddress as m,isAddress as he,parseAbi as U,zeroAddress as ke}from"viem";var T=m(N[u].hoodlock.locker.address),C=m(N[u].hoodlock.burner.address),v=m(N[u].hoodlock.liquidityLocker.address),j=m(N[u].uniswap.v3_position_manager.address),K=m(N[u].uniswap.v4_position_manager.address),qe="0x000000000000000000000000000000000000dEaD",Ae=3153600000n,Te=1000000000000n,fe=65535,D=U(["function fee() view returns (uint256)","function lock(address token, uint256 amount, uint256 unlockTime) payable returns (uint256 lockId)","function getLock(uint256 lockId) view returns (address owner, address token, uint256 amount, uint256 unlockTime, bool withdrawn)","function locksByOwner(address owner) view returns (uint256[])","function locksByToken(address token) view returns (uint256[])"]),ee=U(["function fee() view returns (uint256)","function burn(address token, uint256 amount) payable returns (uint256 burnId)","function DEAD() view returns (address)","function getBurn(uint256 burnId) view returns (address burner, address token, uint256 amount, uint256 timestamp)","function totalBurnedOf(address token) view returns (uint256)"]),O=U(["function fixedFee() view returns (uint256)","function collectFeeBps() view returns (uint16)","function paused() view returns (bool)","function lock(address manager, uint256 tokenId, uint256 unlockTime, address feeRecipient, bool acceptUnverifiedHook, uint16 maxCollectFeeBps) payable returns (uint256 lockId)","function lockIdOf(address manager, uint256 tokenId) view returns (uint256)","function getLock(uint256 lockId) view returns (address owner, uint40 unlockTime, uint16 collectFeeBps, bool isV4, bool hookVerified, bool withdrawn, address feeRecipient, address token0, address token1, uint256 tokenId)","function locksOf(address owner) view returns (uint256[])"]),ye=U(["function approve(address to, uint256 tokenId)"]);function $e(e,o,t){let a=o.trim();if(a.startsWith("-")){let k=a.slice(1),i=e(k,t);return i==="0"?"0":`-${i}`}return e(a,t)}function pe(e,o){return o.length===0?"no ERC-20 transfer deltas":o.map(t=>`${$e(e.formatAmount,t.amount,t.token.decimals)} ${t.token.symbol}`).join(", ")}function E(e,o="token"){if(typeof e!="string"||!e.trim())throw new c(`Provide a valid ${o} contract address.`);if(!he(e,{strict:!1}))throw new c(`Identify ${o} by chain and contract address, not by symbol.`);return m(e)}async function W(e,o){try{return await o()}catch(t){throw new c(e.plainError(t))}}function we(e){if(typeof e!="string")throw new c("Amount must be a non-negative integer string in base units.");let o=H(e);if(o<=0n)throw new c("Amount must be greater than zero.");return o}async function ge(e){let o=await e.getBlock();if(!o||typeof o.timestamp!="bigint")throw new c("Could not read the current chain timestamp. Please try again.");return o.timestamp}function ve(e,o){if(typeof e!="string"||!/^\d+$/.test(e.trim()))throw new c("unlockTime must be a non-negative integer string in Unix seconds.");let t=BigInt(e.trim());if(t>=Te)throw new c("unlockTime appears to be in milliseconds; provide Unix seconds at most 100 years (3153600000 seconds) in the future.");if(t<=o)throw new c(`unlockTime (${t}) must be in the future (greater than current timestamp ${o}).`);let a=o+Ae;if(t>a)throw new c(`unlockTime (${t}) exceeds the 100-year maximum lock duration (3153600000 seconds; max ${a}).`);return t}async function oe(e,o,t=u){let a=m(o),[k,i]=await Promise.all([e.readContract({address:a,abi:me,functionName:"symbol"}),e.readContract({address:a,abi:me,functionName:"decimals"})]);return{address:a,symbol:ce(String(k)),decimals:Number(i),chainId:t}}function Se(e,o){if(e==null)return o;let t=typeof e=="number"?e:typeof e=="string"&&/^\d+$/.test(e.trim())?Number(e.trim()):NaN;if(!Number.isInteger(t)||t<0||t>fe)throw new c("maxCollectFeeBps must be an integer between 0 and 65535.");if(t<o)throw new c(`Live collectFeeBps (${o}) exceeds maxCollectFeeBps (${t}): collect fee changed.`);return Math.min(t,o)}function Le(e){return e.tokenId!==void 0||e.manager!==void 0||e.feeRecipient!==void 0||e.maxCollectFeeBps!==void 0||e.acceptUnverifiedHook!==void 0||e.kind==="v3"||e.kind==="lp"||e.kind==="v4"||e.version==="v3"||e.version==="v4"}async function xe(e,o,t){_(t);let a=m(t),k=o.kind==="v4"||o.version==="v4",i=o.manager!==void 0?E(o.manager,"manager"):k?K:j,g=i===K;if(i!==j&&!g)throw new c(`Unsupported position manager ${i}; use the configured Uniswap v3 or v4 manager.`);if(k&&!g||g&&(o.kind==="v3"||o.version==="v3"))throw new c("The requested version disagrees with the position manager.");if(o.acceptUnverifiedHook!==void 0&&typeof o.acceptUnverifiedHook!="boolean")throw new c("acceptUnverifiedHook must be a boolean.");let b=o.acceptUnverifiedHook===!0;if(!g&&b)throw new c("Uniswap v3 has no hooks; omit acceptUnverifiedHook.");let s=g?"v4":"v3";if(typeof o.tokenId!="string")throw new c("Provide an NFT tokenId as a decimal string.");let f=String(o.tokenId).trim(),d=H(f),l=ue(o.feeRecipient,"Provide an explicit feeRecipient address for LP position locks."),p=e.clientFor(u),[x,I,h]=await Promise.all([ge(p),p.readContract({address:v,abi:O,functionName:"fixedFee"}),p.readContract({address:v,abi:O,functionName:"collectFeeBps"})]),y,$=!0;if(g){let P=U(["function getPoolAndPositionInfo(uint256 tokenId) view returns ((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey, uint256 info)","function getPositionLiquidity(uint256 tokenId) view returns (uint128)","function ownerOf(uint256 tokenId) view returns (address)"]),[Y,J,M]=await Promise.all([p.readContract({address:i,abi:P,functionName:"getPoolAndPositionInfo",args:[d]}),p.readContract({address:i,abi:P,functionName:"getPositionLiquidity",args:[d]}),p.readContract({address:i,abi:P,functionName:"ownerOf",args:[d]})]);if(m(M)!==a)throw new c("This wallet does not own that v4 position NFT.");if(J<=0n)throw new c("The v4 position has no liquidity to lock.");if(y=m(Y[0].hooks),$=y===ke||await p.readContract({address:v,abi:U(["function hookAllowed(address) view returns (bool)"]),functionName:"hookAllowed",args:[y]}),!$&&!b)throw new c(`Unverified v4 hook ${y}; review its risks and explicitly set acceptUnverifiedHook: true to proceed.`)}let A=ve(o.unlockTime,x),n=BigInt(I),r=Number(h);if(!Number.isInteger(r)||r<0||r>fe)throw new c(`Invalid on-chain collectFeeBps (${String(h)}).`);if(o.maxFee!==void 0){let P=H(String(o.maxFee));if(n>P)throw new c(`Live fixedFee (${n}) exceeds maxFee (${P}).`)}let w=Se(o.maxCollectFeeBps,r),L=(r/100).toString(),R=e.unsignedTx({to:i,data:z({abi:ye,functionName:"approve",args:[v,d]}),value:"0",chainId:u,description:`Approve Uniswap ${s} position NFT #${d} on ${i} for HoodLock LiquidityLocker ${v}.`}),F=e.unsignedTx({to:v,data:z({abi:O,functionName:"lock",args:[i,d,A,l,b,w]}),value:n.toString(),chainId:u,description:`Lock Uniswap ${s} NFT #${d} in HoodLock LiquidityLocker (${v}) until ${A} with feeRecipient ${l}, upfront fixedFee ${e.formatAmount(n.toString(),S.decimals)} ETH (${n} wei), and ongoing collect fee ${r} bps (${L}% of collected LP fees, frozen per lock).`}),X=[R,F],V=await e.preview(X,a),Q=`Approve and lock Uniswap ${s} NFT #${d} (manager ${i}) in HoodLock LiquidityLocker ${v} until Unix ${A}. Upfront fixedFee: ${e.formatAmount(n.toString(),S.decimals)} ETH (${n} wei). Ongoing LP fee share: ${r} bps (${L}% of collected LP fees, frozen per lock; maxCollectFeeBps=${w}) with feeRecipient ${l}. V4 hook: ${y??"none"}, reviewed: ${$}; acceptUnverifiedHook=${b}.`;return q(e,{txs:V.txs,summary:Q,preview:V,kind:s,contract:v,manager:i,tokenId:d.toString(),unlockTime:A.toString(),feeRecipient:l,acceptUnverifiedHook:b,collectFeeBps:r,maxCollectFeeBps:w,fixedFee:{token:S,amount:n.toString()}},v,n)}async function Ie(e,o,t){_(t);let a=m(t),k=E(o.token,"token"),i=e.clientFor(u),[g,b,s]=await Promise.all([ge(i),i.readContract({address:T,abi:D,functionName:"fee"}),oe(i,k,u)]),f=we(o.amount),d=ve(o.unlockTime,g),l=BigInt(b);if(o.maxFee!==void 0){let A=H(String(o.maxFee));if(l>A)throw new c(`Live lock fee (${l}) exceeds maxFee (${A}).`)}let p=e.approval(s.address,T,f.toString(),u),x=e.unsignedTx({to:T,data:z({abi:D,functionName:"lock",args:[s.address,f,d]}),value:l.toString(),chainId:u,description:`Lock ${e.formatAmount(f.toString(),s.decimals)} ${s.symbol} (${f} base units of ${s.address}) in HoodLock Locker ${T} until ${d} with exact fee ${e.formatAmount(l.toString(),S.decimals)} ETH (${l} wei).`}),I=[p,x],h=await e.preview(I,a),y=pe(e,h.changes),$=`Approve and lock ${e.formatAmount(f.toString(),s.decimals)} ${s.symbol} (${f} base units of ${s.address}) in HoodLock Locker ${T} until Unix ${d}. Exact fee: ${e.formatAmount(l.toString(),S.decimals)} ETH (${l} wei). Preview changes: ${y}.`;return q(e,{txs:h.txs,summary:$,preview:h,kind:"token",contract:T,token:s,amount:f.toString(),unlockTime:d.toString(),fee:{token:S,amount:l.toString()}},T,l)}function Pe(e){return{name:"hoodlock_lock",inputSchema:{type:"object",properties:{kind:{type:"string",enum:["token","v2","v3","v4"],description:"Lock mode: token/v2 LP via Locker, or Uniswap v3/v4 NFT via LiquidityLocker."},token:{type:"string",description:"ERC-20 token or v2 LP token contract address on chain 4663 (for token/v2 locks)."},amount:{type:"string",description:"Token amount as an integer string in base units (for token/v2 locks)."},manager:{type:"string",description:"Configured Uniswap v3 or v4 position manager; inferred from kind when omitted."},tokenId:{type:"string",description:"Uniswap NFT position tokenId as a decimal string."},feeRecipient:{type:"string",description:"Explicit recipient address for collected LP fees during a position lock."},acceptUnverifiedHook:{type:"boolean",description:"Explicit v4 unreviewed-hook consent; default false. A reviewed hook is not a safety guarantee."},maxFee:{type:"string",description:"Maximum upfront ETH fee in wei; the exact live fee is sent."},maxCollectFeeBps:{type:"number",description:"Maximum acceptable ongoing LP collect fee in bps (uint16, must be >= live collectFeeBps)."},unlockTime:{type:"string",description:"Unlock timestamp in Unix seconds (must be > now and <= now + 100 years)."}},required:["unlockTime"],additionalProperties:!1},async execute(o,t){return W(e,async()=>Le(o)?xe(e,o,t):Ie(e,o,t))}}}function Ce(e){return{name:"hoodlock_burn",inputSchema:{type:"object",properties:{token:{type:"string",description:"ERC-20 token contract address on chain 4663 to send to the dead address via HoodLock Burner."},amount:{type:"string",description:"Amount to burn as an integer string in base units."}},required:["token","amount"],additionalProperties:!1},async execute(o,t){return W(e,async()=>{_(t);let a=m(t),k=E(o.token,"token"),i=e.clientFor(u),[g,b,s]=await Promise.all([i.readContract({address:C,abi:ee,functionName:"fee"}),i.readContract({address:C,abi:ee,functionName:"DEAD"}),oe(i,k,u)]),f=we(o.amount),d=BigInt(g),l=m(b);if(o.maxFee!==void 0){let A=H(String(o.maxFee));if(d>A)throw new c(`Live burn fee (${d}) exceeds maxFee (${A}).`)}let p=e.approval(s.address,C,f.toString(),u),x=e.unsignedTx({to:C,data:z({abi:ee,functionName:"burn",args:[s.address,f]}),value:d.toString(),chainId:u,description:`Send ${e.formatAmount(f.toString(),s.decimals)} ${s.symbol} (${f} base units of ${s.address}) to the dead address (${l}) via HoodLock Burner ${C} (totalSupply is unchanged) with exact fee ${e.formatAmount(d.toString(),S.decimals)} ETH (${d} wei).`}),I=[p,x],h=await e.preview(I,a),y=pe(e,h.changes),$=`Approve and send ${e.formatAmount(f.toString(),s.decimals)} ${s.symbol} (${f} base units of ${s.address}) to the dead address (${l}) via HoodLock Burner ${C}. Note: tokens are transferred to ${l} and totalSupply is unchanged. Exact fee: ${e.formatAmount(d.toString(),S.decimals)} ETH (${d} wei). Preview changes: ${y}.`;return q(e,{txs:h.txs,summary:$,preview:h,contract:C,deadAddress:l,token:s,amount:f.toString(),fee:{token:S,amount:d.toString()},totalSupplyReduced:!1},C,d)})}}}async function be(e,o,t){_(o);let a=m(o),k=t?E(t,"token"):void 0,i=e.clientFor(u),g=[],b=new Set,s=n=>{for(let r of n){let w=r.toString();b.has(w)||(b.add(w),g.push(r))}};if(k){let[n,r]=await Promise.all([i.readContract({address:T,abi:D,functionName:"locksByToken",args:[k]}),i.readContract({address:T,abi:D,functionName:"locksByOwner",args:[a]})]);s(n),s(r)}else{let n=await i.readContract({address:T,abi:D,functionName:"locksByOwner",args:[a]});s(n)}let d=(await Promise.all(g.map(async n=>{let r=await i.readContract({address:T,abi:D,functionName:"getLock",args:[n]});return{id:n,owner:m(r[0]),token:m(r[1]),amount:BigInt(r[2]),unlockTime:BigInt(r[3]),withdrawn:!!r[4]}}))).filter(n=>!n.withdrawn&&n.amount>0n&&B(n.owner,a)&&(!k||B(n.token,k))),l=new Map,p=async n=>{let r=n.toLowerCase(),w=l.get(r);if(w)return w;let L=n===ke?S:await oe(i,n,u);return l.set(r,L),L},x=[],I=[];for(let n of d){let r=await p(n.token),w=n.amount.toString(),L=n.unlockTime.toString(),R={token:r,amount:w};x.push({lockId:n.id.toString(),kind:"token",contract:T,chainId:u,owner:n.owner,token:r,amount:w,asset:R,unlockTime:L,withdrawn:!1}),I.push({module:"hoodlock",id:`lock:${n.id.toString()}`,chainId:u,assets:[R],description:`HoodLock token lock #${n.id} of ${e.formatAmount(w,r.decimals)} ${r.symbol} (${r.address}) until Unix ${L}.`})}let h=await i.readContract({address:v,abi:O,functionName:"locksOf",args:[a]}),y=[...new Set(h.map(n=>n.toString()))].map(n=>BigInt(n)),$=[];for(let n of y){let r=await i.readContract({address:v,abi:O,functionName:"getLock",args:[n]}),[w,L,R,F,X,V,Q,P,Y,J]=r,M=m(w);if(V||!B(M,a))continue;let ne=m(P),te=m(Y);if(k&&!B(ne,k)&&!B(te,k))continue;let[ie,re]=await Promise.all([p(ne),p(te)]),se=m(Q),ae=Number(R),de=BigInt(L).toString(),Z=BigInt(J).toString();$.push({lockId:n.toString(),kind:F?"v4":"v3",contract:v,manager:F?K:j,chainId:u,owner:M,tokenId:Z,unlockTime:de,collectFeeBps:ae,feeRecipient:se,hookVerified:!!X,token0:ie,token1:re,withdrawn:!1}),I.push({module:"hoodlock",id:`lp-lock:${n.toString()}`,chainId:u,assets:[{token:{address:F?K:j,symbol:`UNI-${F?"V4":"V3"} #${Z}`,decimals:0,chainId:u},amount:"1"}],description:`HoodLock Uniswap ${F?"v4":"v3"} LP lock #${n} (NFT #${Z}, ${ie.symbol}/${re.symbol}, feeRecipient ${se}, collectFeeBps ${ae}) until Unix ${de}. One NFT held in LiquidityLocker custody for ${M}. Underlying token amounts are not valued.`})}let A=`Found ${x.length} active token lock(s) and ${$.length} active Uniswap v3/v4 LP lock(s) for ${a}.`;return{locks:x,lpLocks:$,positions:I,summary:A}}function Fe(e){return{name:"hoodlock_list_locks",inputSchema:{type:"object",properties:{owner:{type:"string",description:"Optional owner wallet address to query (defaults to the authenticated wallet)."},token:{type:"string",description:"Optional ERC-20 or LP token address to filter active locks owned by the wallet."}},additionalProperties:!1},async execute(o,t){let a=o.owner!==void 0?E(o.owner,"owner"):m(t),k=o.token!==void 0?E(o.token,"token"):void 0;return W(e,()=>be(e,a,k))}}}function Re(e){return async o=>(await W(e,()=>be(e,o))).positions}var G=e=>({tools:[Pe(e),Ce(e),Fe(e)],positions:Re(e)}),ze=G,je=G,Ke=e=>le("hoodlock",[G(e)]),We=G;export{T as a,C as b,v as c,j as d,K as e,qe as f,Ae as g,$e as h,Pe as i,Ce as j,Fe as k,Re as l,G as m,ze as n,je as o,Ke as p,We as q};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./XSD5NL7J.js";function s(t){if(typeof t!="string"||!/^\d+$/.test(t))throw new e('Amount must be a non-negative integer string in base units. For example, "10000000" = 10 USDG (6 decimals).');return BigInt(t)}function u(t){if(!Number.isInteger(t)||t<0||t>255)throw new e("Token decimals must be an integer from 0 to 255.");return 10n**BigInt(t)}function f(t,i,n){if(i<=0n)throw new e("The denominator must be positive.");if(n!=="floor"&&n!=="ceil")throw new e("Choose floor or ceil rounding.");return t/i+(n==="ceil"&&t%i!==0n?1n:0n)}function p(t,i,n){let o=u(i);if(typeof t!="string"||!/^\d+(\.\d+)?$/.test(t))throw new e("Amount must be a non-negative decimal string.");let[r="0",c=""]=t.split("."),g=c.slice(i);if(n===void 0&&/[1-9]/.test(g))throw new e("Amount exceeds the token precision. Choose floor or ceil rounding.");if(n!==void 0&&n!=="floor"&&n!=="ceil")throw new e("Choose floor or ceil rounding.");return(BigInt(r)*o+BigInt(c.slice(0,i).padEnd(i,"0")||"0")+(n==="ceil"&&/[1-9]/.test(g)?1n:0n)).toString()}function a(t,i){let n=s(t),o=u(i),r=(n%o).toString().padStart(i,"0").replace(/0+$/,"");return`${n/o}${r?`.${r}`:""}`}function b(t,i,n,o){return f(s(t)*s(i),s(n),o).toString()}export{s as a,p as b,a as c,b as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as d}from"./XSD5NL7J.js";var i=class extends d{constructor(r,n){super(`${r} is busy; retry in ${Math.max(1,Math.ceil(n))} seconds.`);this.vendor=r;this.retryAfterSeconds=n}vendor;retryAfterSeconds},y=new WeakMap,b={"aggregator-api.kyberswap.com":{label:"KyberSwap",spacing:350},"api.velora.xyz":{label:"Velora",spacing:1050,daily:5e3},"api.relay.link":{label:"Relay",spacing:1250},"api-v2.pendle.finance":{label:"Pendle",spacing:2e3,daily:5e3}};function p(a,c){let r=new URL(c).hostname,n=b[r];if(!n)return;let s=y.get(a);s||(s=new Map,y.set(a,s));let e=s.get(r);return e||(e={next:0,blockedUntil:0,lastSent:-1/0,daily:[]},s.set(r,e)),{label:n.label,reserve(){let t=Date.now();if(e.daily=e.daily.filter(o=>o>t-864e5),n.daily&&e.daily.length>=n.daily)throw new i(n.label,(e.daily[0]+864e5-t)/1e3);let l=Math.max(t,e.next,e.blockedUntil,e.lastSent+n.spacing);if(l-t>2e3)throw new i(n.label,(l-t)/1e3);return e.next=l+n.spacing,l-t},dispatchDelay(){let t=Date.now();if(e.daily=e.daily.filter(o=>o>t-864e5),n.daily&&e.daily.length>=n.daily)throw new i(n.label,(e.daily[0]+864e5-t)/1e3);if(e.blockedUntil>t)throw new i(n.label,(e.blockedUntil-t)/1e3);let l=Math.max(0,e.lastSent+n.spacing-t);return l===0&&(e.lastSent=t,n.daily&&e.daily.push(t)),l},backoff(t){e.blockedUntil=Math.max(e.blockedUntil,Date.now()+t)}}}function f(a){return a instanceof d&&/^(KyberSwap|Velora|Relay|Pendle|The service) is busy; retry in [1-9]\d* seconds\.$/.test(a.message)?a:void 0}export{i as a,p as b,f as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as K}from"./65EQECL3.js";import{c as j}from"./MYFAKCQI.js";import{d as N}from"./F26FK47J.js";import{g as S}from"./5KUWLUPM.js";import{a as M,b as O}from"./UP7FBDMJ.js";import{a as q,i as z}from"./FWD4L3CJ.js";import{a as i}from"./XSD5NL7J.js";import{a as $}from"./JXOEJPJ4.js";import{encodeAbiParameters as se,encodeFunctionData as G,erc20Abi as W,getAddress as J,isAddress as ce,keccak256 as V,parseAbi as me,parseAbiParameters as ue,zeroAddress as Z}from"viem";var x=q,C=J(z[x].hoodlock.airdrop.address),ee="https://hoodlock.tech",E=25e4,ye=256,ge=604800n,fe=30n,X=250000000000000000n,Q=0xffffffffn,pe=(1n<<64n)-1n,oe=(1n<<128n)-1n,ne="0x0000000000000000000000000000000000000000000000000000000000000000",be="0x1111111111111111111111111111111111111111",xe=ue("uint256, address, uint256"),T=me(["function quote(uint32 maxClaims) view returns (uint256)","function create(address token, bytes32 merkleRoot, uint256 total, uint32 maxClaims, uint64 endTime, string uri) payable returns (uint256 id)","function claim(uint256 id, uint256 index, address account, uint256 amount, bytes32[] proof)","function getAirdrop(uint256 id) view returns (address creator, uint64 endTime, uint32 maxClaims, address token, uint32 claims, bool swept, bytes32 merkleRoot, uint128 total, uint128 remaining)","function isClaimed(uint256 id, uint256 index) view returns (bool)"]);function Ae(o,e,t){let n=e.trim();if(n.startsWith("-")){let r=n.slice(1);return`-${o.formatAmount(r,t)}`}let d=n.startsWith("+")?n.slice(1):n;return o.formatAmount(d,t)}function te(o,e){if(!e.changes.length)return e.summary;let t=e.changes.map(n=>`${Ae(o,n.amount,n.token.decimals)} ${$(n.token.symbol)}`).join(", ");return`${e.summary} (${t})`}async function he(o,e){try{let[t,n]=await Promise.all([o.readContract({address:e,abi:W,functionName:"symbol"}),o.readContract({address:e,abi:W,functionName:"decimals"})]),d=typeof t=="string"&&t.trim()?t.trim():"TOKEN",r=Number(n);return{symbol:d,decimals:Number.isInteger(r)&&r>=0&&r<=255?r:18}}catch{return{symbol:"TOKEN",decimals:18}}}function w(o,e,t){if(typeof e=="string"&&e.includes(".")){if(t?.decimals===void 0)throw new i(`Decimal string amount "${e}" requires explicit token decimals; amount inputs are base-unit integer strings by default.`);let d=t.rounding!==void 0?O(e,t.decimals,t.rounding):o?o.parseAmount(e,t.decimals):O(e,t.decimals),r=M(d);if(r<=0n)throw new i("Airdrop entry amount must be positive.");return r}let n;try{if(typeof e=="bigint")n=e;else if(typeof e=="string")n=M(e.trim());else throw new i("Amount must be a non-negative integer string in base units.")}catch(d){throw d instanceof i?d:new i(`Invalid airdrop amount "${String(e)}".`,{cause:d})}if(n<=0n)throw new i("Airdrop entry amount must be strictly positive (> 0).");return n}function H(o,e){try{let t=typeof o=="bigint"?o:BigInt(String(o).trim());if(t<0n)throw new i(`${e} must be non-negative.`);return t}catch(t){throw t instanceof i?t:new i(`Invalid ${e}: ${String(o)}`,{cause:t})}}function A(o,e){if(typeof o!="string"||!ce(o,{strict:!1}))throw new i(`Invalid ${e} address "${String(o)}": token/account must be a valid EVM address, never a symbol.`);return J(o)}function L(o,e,t){let n=typeof o=="bigint"?o:BigInt(o);if(n<0n||n>Q)throw new i(`Airdrop leaf index must be in 0..${Q.toString()}.`);let d=A(e,"account"),r=w(void 0,t),s=se(xe,[n,d,r]);return V(V(s))}function re(o,e){let t=o;for(let n of e)t=N(t,n);return t}function Oe(o){try{let e=L(o.index,o.account,o.amount),t=re(e,o.proof);return S(t,o.root)}catch{return!1}}function U(o,e){if(!Array.isArray(o)||o.length===0)throw new i("Airdrop entries list cannot be empty; maxClaims must be in 1..250000.");if(o.length>E)throw new i(`Airdrop entries length (${o.length}) exceeds maxClaims limit of ${E}.`);let t=[],n=0n;for(let a=0;a<o.length;a+=1){let l=o[a];if(!l)throw new i(`Missing airdrop entry at position ${a}.`);let c=l.index??a;if(!Number.isInteger(c)||c!==a)throw new i(`Airdrop entry index at position ${a} must be contiguous ${a} (got ${String(c)}).`);let u=A(l.account,`entries[${a}].account`),g=w(e?.context,l.amount,e);n+=g,t.push({index:c,account:u,amount:g.toString()})}if(n<=0n||n>oe)throw new i("Airdrop total amount must be > 0 and fit in uint128.");let d=t.map(a=>L(a.index,a.account,a.amount)),r=[d];for(;r[r.length-1].length>1;){let a=r[r.length-1],l=[];for(let c=0;c<a.length;c+=2){let u=a[c],g=a[c+1];g===void 0?l.push(u):l.push(N(u,g))}r.push(l)}let s=r[r.length-1][0];if(s.toLowerCase()===ne)throw new i("Computed Merkle root cannot be zero.");let f=r.length>1?r[1]:r[0],m=t.map((a,l)=>{let c=[],u=l;for(let g=0;g<r.length-1;g+=1){let y=r[g],b=u^1;b<y.length&&c.push(y[b]),u=Math.floor(u/2)}return{index:a.index,account:a.account,amount:a.amount,leaf:d[l],proof:c}}),p={format:"openzeppelin-standard-merkle-tree-v1",leafEncoding:["uint256","address","uint256"],root:s,totalAmount:n.toString(),maxClaims:t.length,values:t.map(a=>[a.index,a.account,a.amount]),entries:t};return{root:s,leaves:d,level1:f,totalAmount:n.toString(),maxClaims:t.length,entries:t,proofs:m,list:p}}function we(o){if(!o||!Array.isArray(o.entries)&&!Array.isArray(o.values))throw new i("Saved airdrop list is missing entries/values.");let e=Array.isArray(o.entries)&&o.entries.length>0?o.entries:o.values.map(([n,d,r])=>({index:n,account:d,amount:r})),t=U(e);if(o.root&&!S(t.root,o.root))throw new i(`Rebuilt tree root ${t.root} does not match saved list root ${o.root}.`);if(o.maxClaims!==void 0&&t.maxClaims!==o.maxClaims)throw new i(`Rebuilt maxClaims (${t.maxClaims}) does not match saved list maxClaims (${o.maxClaims}).`);if(o.totalAmount!==void 0&&t.totalAmount!==o.totalAmount)throw new i(`Rebuilt totalAmount (${t.totalAmount}) does not match saved list totalAmount (${o.totalAmount}).`);return t}async function ie(o,e){return j(o.http,e,{method:"GET"},t=>t!==null&&typeof t=="object")}async function ke(o,e,t){let n=A(e.token,"token");if(n===Z)throw new i("Airdrop token cannot be the zero address.");let d=U(e.entries,{decimals:e.decimals,rounding:e.rounding,context:o}),r=e.maxClaims??d.maxClaims;if(!Number.isInteger(r)||r<1||r>E||r!==d.maxClaims)throw new i(`maxClaims (${String(r)}) must equal entries.length (${d.maxClaims}) and be in 1..${E}.`);let s=BigInt(d.totalAmount),f=e.total!==void 0?w(o,e.total,{decimals:e.decimals,rounding:e.rounding}):s;if(f<s)throw new i(`Airdrop total (${f.toString()}) is less than the sum of entry amounts (${s.toString()}).`);if(f<=0n||f>oe)throw new i("Airdrop total must be positive and fit in uint128.");let m=e.uri??"",p=new TextEncoder().encode(m).byteLength;if(p>ye)throw new i(`Airdrop URI length (${p} bytes) exceeds 256-byte limit.`);let a=e.endTime!==void 0?H(e.endTime,"endTime"):0n;if(a>pe)throw new i("endTime exceeds uint64 maximum.");let l=o.clientFor(x),c=await l.getCode({address:n});if(!c||c==="0x")throw new i(`Token ${n} has no contract code on chain ${x}.`);let u;if(a!==0n){let _=(await l.getBlock()).timestamp,B=e.inclusionMargin!==void 0?H(e.inclusionMargin,"inclusionMargin"):fe;if(B<=0n)throw new i("inclusionMargin must be at least 1 second to leave room for signing and inclusion after the already-mined block.");let D=_+B,I=e.inclusionTime!==void 0?H(e.inclusionTime,"inclusionTime"):D;if(I<D)throw new i(`inclusionTime (${I.toString()}) must be after the already-mined block (${_.toString()}) with room for signing and inclusion (>= ${D.toString()}).`);u=I;let F=I+ge;if(a<F)throw new i(`endTime (${a.toString()}) is too short (window too short): must be 0 or at least inclusion time (${I.toString()}) + 604800 (7 days >= ${F.toString()}, after already-mined block.timestamp ${_.toString()}).`)}let g=await l.readContract({address:C,abi:T,functionName:"quote",args:[r]}),y=typeof g=="bigint"?g:BigInt(String(g));if(y<0n||y>X)throw new i(`HoodLock quote(uint32) fee (${y.toString()}) exceeds max fee cap (${X.toString()}).`);let b=o.formatAmount(y.toString(),K.decimals),h=o.approval(n,C,f.toString(),x),k=o.unsignedTx({chainId:x,to:C,data:G({abi:T,functionName:"create",args:[n,d.root,f,r,a,m]}),value:y.toString(),description:`Create HoodLock airdrop (${r} claims, total ${f.toString()}, quote fee ${b} ETH (${y.toString()} wei))`}),v=[h,k],P=A(e.account??t??be,"wallet"),R=await o.preview(v,P),de=y>0n?` Quote fee: -${b} ETH (${b} ETH / ${y.toString()} wei).`:" Quote fee: 0 ETH (0 wei).",le=`${te(o,R)}${de}`;return{kind:"hoodlock_airdrop_create",chainId:x,token:n,merkleRoot:d.root,totalAmount:d.totalAmount,total:f.toString(),maxClaims:r,endTime:a,...u!==void 0?{inclusionTime:u}:{},uri:m,quoteFee:y,list:d.list,proofs:d.proofs,txs:v,preview:R,summary:le}}async function Y(o,e,t,n){if(n.savedProof){let m=A(n.savedProof.account,"savedProof.account");if(m!==t)throw new i(`savedProof account (${m}) does not match claim account (${t}).`);return{index:n.savedProof.index,amount:w(o,n.savedProof.amount),proof:n.savedProof.proof}}if(n.proof!==void 0&&n.index!==void 0&&n.amount!==void 0){let m=Number(n.index);if(!Number.isInteger(m)||m<0)throw new i(`Invalid claim index: ${String(n.index)}`);return{index:m,amount:w(o,n.amount),proof:n.proof}}if(n.list||n.entries){let p=(n.list?we(n.list):U(n.entries,{context:o})).proofs.find(a=>!(!S(a.account,t)||n.index!==void 0&&a.index!==Number(n.index)));if(!p)throw new i(`Account ${t} was not found in the saved airdrop list.`);return{index:p.index,amount:w(o,p.amount),proof:p.proof}}let d=`${ee}/api/airdrop/${e.toString()}/proof?address=${t}`,r=await ie(o,d),s=r?.data??r;if(!s||s.index===void 0||s.amount===void 0||!Array.isArray(s.proof))throw new i(`No valid proof returned from HoodLock API for airdrop ${e.toString()} and account ${t}.`);let f=Number(s.index);if(!Number.isInteger(f)||f<0)throw new i(`Invalid index in API proof: ${String(s.index)}`);return{index:f,amount:w(o,s.amount),proof:s.proof}}async function ae(o,e){let t=o.clientFor(x),n=await t.readContract({address:C,abi:T,functionName:"getAirdrop",args:[e.id]}),[d,r,s,f,m,p,a,,l]=n,c=BigInt(r),u=Number(s),g=Number(m),y=BigInt(l),b=A(f,"airdrop.token");if(d===Z||a.toLowerCase()===ne)throw new i(`Airdrop ${e.id.toString()} does not exist.`);if(p)throw new i(`Airdrop ${e.id.toString()} has already been swept.`);if(c>0n&&(await t.getBlock()).timestamp>=c)throw new i(`Airdrop ${e.id.toString()} expired at timestamp ${c.toString()}.`);if(g>=u)throw new i(`Airdrop ${e.id.toString()} has reached maxClaims (${u}).`);let[h,k]=await Promise.all([t.readContract({address:C,abi:T,functionName:"isClaimed",args:[e.id,BigInt(e.index)]}),he(t,b)]);if(h)throw new i(`Airdrop ${e.id.toString()} index ${e.index} has already been claimed.`);if(y<e.amount)throw new i(`Airdrop ${e.id.toString()} remaining balance (${y.toString()}) is less than claim amount (${e.amount.toString()}).`);let v=L(e.index,e.account,e.amount),P=re(v,e.proof);if(!S(P,a))throw new i(`Computed Merkle root ${P} does not match on-chain airdrop root ${a} (bad proof).`);return{tokenAddress:b,tokenMeta:k,merkleRoot:a,leaf:v}}async function $e(o,e){let{tokenAddress:t,tokenMeta:n,merkleRoot:d,leaf:r}=await ae(o,e),s=e.caller??e.account,f=!S(s,e.account),m=o.formatAmount(e.amount.toString(),n.decimals),p=o.unsignedTx({chainId:x,to:C,data:G({abi:T,functionName:"claim",args:[e.id,BigInt(e.index),e.account,e.amount,[...e.proof]]}),value:"0",description:f?`Claim ${m} ${$(n.symbol)} (${e.amount.toString()} base units) from HoodLock airdrop #${e.id.toString()} for recipient ${e.account} (caller ${s} pays gas only, token delta 0)`:`Claim ${m} ${$(n.symbol)} (${e.amount.toString()} base units) from HoodLock airdrop #${e.id.toString()} for ${e.account}`}),a=[p],l=await o.preview(a,s),c,u,g=e.amount.toString(),y;if(f){let b=l.changes.filter(h=>h.amount.trim().startsWith("-"));c={...l,changes:b,summary:`${l.summary} Recipient ${e.account} receives ${m} ${$(n.symbol)} (${e.amount.toString()} base units); caller ${s} change is 0 (gas only).`},u=`Third-party claim from HoodLock airdrop #${e.id.toString()} (index ${e.index}): recipient ${e.account} receives ${m} ${$(n.symbol)} (${e.amount.toString()} base units of ${t}); caller ${s} own token change is 0 (gas only). ${l.summary}`,y="0"}else c=l,u=`Claim ${m} ${$(n.symbol)} (${e.amount.toString()} base units of ${t}) from HoodLock airdrop #${e.id.toString()} (index ${e.index}) for recipient ${e.account}. ${te(o,c)}`,y=e.amount.toString();return{kind:"hoodlock_airdrop_claim",chainId:x,id:e.id,index:e.index,account:e.account,recipient:e.account,caller:e.caller,token:t,amount:e.amount.toString(),recipientDelta:g,senderDelta:y,leaf:r,merkleRoot:d,proof:[...e.proof],tx:p,txs:a,preview:c,summary:u}}async function Se(o,e,t){let n=A(e.account??t??"","account"),d=e.caller!==void 0?A(e.caller,"caller"):t!==void 0?A(t,"wallet"):void 0;if(e.id!==void 0){let l=H(e.id,"id"),c=await Y(o,l,n,e);return $e(o,{id:l,index:c.index,account:n,caller:d,amount:c.amount,proof:c.proof})}let r=`${ee}/api/airdrop/eligible?address=${n}`,s=await ie(o,r),f=Array.isArray(s)?s:s?.claimable??s?.eligible??s?.airdrops??s?.claims??[],m=[];for(let l of f){let c=l.id??l.airdropId;if(c!==void 0)try{let u=H(c,"eligible.id"),g,y,b;if(l.index!==void 0&&l.amount!==void 0&&Array.isArray(l.proof))g=Number(l.index),y=w(o,l.amount),b=l.proof;else{let k=await Y(o,u,n,{id:u,account:n});g=k.index,y=k.amount,b=k.proof}let h=await ae(o,{id:u,index:g,account:n,amount:y,proof:b});m.push({id:u.toString(),index:g,account:n,token:h.tokenAddress,amount:y.toString(),proof:[...b],merkleRoot:h.merkleRoot})}catch{continue}}let p=m.length===0?`No verified eligible HoodLock airdrops were returned by the index for ${n}. Discovery can lag after creation; this does not prove there are no claims. If you know the airdrop id, call hoodlock_airdrop_claim with id and account to resolve its list/proof and verify it on-chain.`:`Found ${m.length} eligible HoodLock airdrop(s) for ${n}: ${m.map(l=>`#${l.id}`).join(", ")}. Discovery can lag after creation. Choose an id, or pass a known new id, to hoodlock_airdrop_claim to verify and build a claim transaction.`;return{kind:"hoodlock_airdrop_eligible",chainId:x,account:n,recipient:n,caller:d,recipientDelta:"0",senderDelta:"0",eligible:m,claims:[],tx:void 0,txs:[],preview:{txs:[],changes:[],summary:p},summary:p}}var Ce=o=>({tools:[{name:"hoodlock_airdrop_create",inputSchema:{type:"object",required:["token","entries"],additionalProperties:!1,properties:{token:{type:"string",description:"ERC-20 token contract address on chain 4663"},entries:{type:"array",description:"Ordered airdrop entries [{ index?, account, amount }] with base-unit integer string amounts"},total:{type:"string",description:"Optional total funded token amount as a base-unit integer string (>= sum of entries)"},maxClaims:{type:"number",description:"Optional claim count (must equal entries.length in 1..250000)"},endTime:{type:"number",description:"Unix timestamp in seconds (0 for non-sweepable or >= inclusion time + 604800)"},inclusionTime:{type:"number",description:"Optional expected transaction inclusion Unix timestamp in seconds (> already-mined block.timestamp)"},inclusionMargin:{type:"number",description:"Optional signing and inclusion margin in seconds above the already-mined block.timestamp (>= 1, default 30)"},uri:{type:"string",description:"Metadata URI (<= 256 UTF-8 bytes)"},decimals:{type:"number",description:"Optional token decimals when converting human decimal entry amounts via parseAmount"},rounding:{type:"string",enum:["floor","ceil"],description:"Optional rounding mode (floor or ceil) when converting decimal amounts"},account:{type:"string",description:"Optional creator wallet address for preview simulation"}}},execute:async(e,t)=>ke(o,e,t)},{name:"hoodlock_airdrop_claim",inputSchema:{type:"object",required:["account"],additionalProperties:!1,properties:{id:{type:"string",description:"Optional airdrop ID (omit to query eligible airdrops)"},account:{type:"string",description:"Leaf recipient address that receives the tokens"},caller:{type:"string",description:"Optional caller/relayer address submitting the tx (pays gas only, receives 0 tokens)"},index:{type:"number",description:"Optional leaf index when supplying proof directly or selecting from list/entries"},amount:{type:"string",description:"Optional leaf amount as a base-unit integer string"},proof:{type:"array",items:{type:"string"},description:"Optional Merkle sibling proof array of 32-byte hex strings"},savedProof:{type:"object",description:"Optional saved proof item ({ index, account, amount, leaf?, proof }) from hoodlock_airdrop_create"},list:{type:"object",description:"Optional saved airdrop list ({ format, leafEncoding, root, totalAmount, maxClaims, values, entries }) to rebuild proof locally"},entries:{type:"array",description:"Optional airdrop entries array ([{ index?, account, amount }]) to rebuild proof locally"}}},execute:async(e,t)=>Se(o,e,t)}]}),Ne=Ce;export{W as a,x as b,C as c,ee as d,E as e,ye as f,ge as g,fe as h,X as i,T as j,Ae as k,L as l,re as m,Oe as n,U as o,we as p,Ce as q,Ne as r};
|