@oakagentkit/core 0.2.1 → 0.2.2
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/addresses.d.ts +93 -0
- package/build/dist/api/addresses.js +1 -1
- package/build/dist/api/chain.js +1 -1
- package/build/dist/api/history.js +1 -1
- package/build/dist/api/identity-link.js +1 -1
- package/build/dist/api/metadata.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/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/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/backoff.d.ts +6 -0
- package/build/dist/api/modules/heyresearch/backoff.js +1 -0
- package/build/dist/api/modules/heyresearch/builder-feed.d.ts +62 -0
- package/build/dist/api/modules/heyresearch/builder-feed.js +1 -0
- package/build/dist/api/modules/heyresearch/index.d.ts +3 -0
- package/build/dist/api/modules/heyresearch/index.js +1 -1
- package/build/dist/api/modules/heyresearch/proof-reads.d.ts +7 -0
- package/build/dist/api/modules/heyresearch/proof-reads.js +1 -0
- package/build/dist/api/modules/heyresearch/public-reads.d.ts +1 -0
- package/build/dist/api/modules/heyresearch/public-reads.js +1 -1
- package/build/dist/api/modules/heyresearch/scan.d.ts +31 -0
- package/build/dist/api/modules/heyresearch/scan.js +1 -0
- package/build/dist/api/modules/heyresearch/status-labels.d.ts +5 -0
- package/build/dist/api/modules/heyresearch/status-labels.js +1 -0
- package/build/dist/api/modules/heyresearch/token-facts.d.ts +123 -0
- package/build/dist/api/modules/heyresearch/token-facts.js +1 -0
- 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/buyback.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.d.ts +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.d.ts +63 -0
- package/build/dist/api/modules/hookr/agent-gate.js +1 -0
- 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.d.ts +1 -0
- package/build/dist/api/modules/hookr/index.js +1 -1
- package/build/dist/api/modules/hookr/launch-options.d.ts +119 -0
- package/build/dist/api/modules/hookr/launch-options.js +1 -0
- package/build/dist/api/modules/hookr/launch-profile.d.ts +5 -0
- package/build/dist/api/modules/hookr/launch-profile.js +1 -0
- package/build/dist/api/modules/hookr/launch-receipt.d.ts +144 -0
- package/build/dist/api/modules/hookr/launch-receipt.js +1 -0
- package/build/dist/api/modules/hookr/launch.d.ts +58 -0
- package/build/dist/api/modules/hookr/launch.js +1 -0
- package/build/dist/api/modules/hookr/liquidity.d.ts +48 -0
- package/build/dist/api/modules/hookr/liquidity.js +1 -0
- package/build/dist/api/modules/hookr/lp-positions.d.ts +2 -0
- package/build/dist/api/modules/hookr/lp-positions.js +1 -0
- package/build/dist/api/modules/hookr/lp-reads.d.ts +52 -0
- package/build/dist/api/modules/hookr/lp-reads.js +1 -0
- package/build/dist/api/modules/hookr/lp-receipt.d.ts +136 -0
- package/build/dist/api/modules/hookr/lp-receipt.js +1 -0
- package/build/dist/api/modules/hookr/lp-state.d.ts +33 -0
- package/build/dist/api/modules/hookr/lp-state.js +1 -0
- package/build/dist/api/modules/hookr/pins.d.ts +43 -0
- package/build/dist/api/modules/hookr/pins.js +1 -0
- package/build/dist/api/modules/hookr/public-reads.js +1 -1
- package/build/dist/api/modules/hookr/read-utils.d.ts +59 -0
- package/build/dist/api/modules/hookr/read-utils.js +1 -0
- 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/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/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/desk-read.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/index.js +1 -1
- package/build/dist/api/modules/pons/claim.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/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/bootstrap.js +1 -1
- package/build/dist/api/modules/relay/discovery.js +1 -1
- 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/outbound-status.js +1 -1
- package/build/dist/api/modules/relay/reads.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/discovery.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.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.d.ts +5 -0
- package/build/dist/api/modules/wormhole/index.js +1 -0
- package/build/dist/api/modules/wormhole/license.d.ts +2 -0
- package/build/dist/api/modules/wormhole/license.js +1 -0
- package/build/dist/api/modules/wormhole/quotetext.d.ts +36 -0
- package/build/dist/api/modules/wormhole/quotetext.js +1 -0
- package/build/dist/api/modules/wormhole/scan-text.d.ts +40 -0
- package/build/dist/api/modules/wormhole/scan-text.js +1 -0
- package/build/dist/api/modules/wormhole/token-check.d.ts +54 -0
- package/build/dist/api/modules/wormhole/token-check.js +1 -0
- 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/rpc.js +1 -1
- package/build/dist/api/send.js +1 -1
- package/build/dist/api/signing-registry.js +1 -1
- package/build/dist/api/signing.js +1 -1
- package/build/dist/api/simulate.js +1 -1
- package/build/dist/api/swap.js +1 -1
- package/build/dist/api/tokens.js +1 -1
- package/build/dist/api/tool-policy.js +1 -1
- package/build/dist/api/types.d.ts +7 -0
- package/build/dist/chunks/{QHHZDXRG.js → 2FSX7MMR.js} +1 -1
- package/build/dist/chunks/{RTBOMWCB.js → 2LM7U4S7.js} +1 -1
- package/build/dist/chunks/{BBVKWG65.js → 2MSQ6JII.js} +1 -1
- package/build/dist/chunks/{T6MTTMLQ.js → 2UU5TBBB.js} +1 -1
- package/build/dist/chunks/{OW7GOYKA.js → 2W46IRX6.js} +1 -1
- package/build/dist/chunks/{6LLOTPH2.js → 3EFV4FQF.js} +1 -1
- package/build/dist/chunks/{IAXKPME3.js → 3NDVXEBR.js} +1 -1
- package/build/dist/chunks/3SC5UI35.js +1 -0
- package/build/dist/chunks/{TCS3ICNE.js → 3WBDHUV2.js} +1 -1
- package/build/dist/chunks/{UPPYXY74.js → 4AKIXLXH.js} +1 -1
- package/build/dist/chunks/{RRSODRGT.js → 4GAWMCQC.js} +1 -1
- package/build/dist/chunks/{ZGXNTWYG.js → 4GHVIBL5.js} +1 -1
- package/build/dist/chunks/{NHCRJC5X.js → 4KQZTPMS.js} +1 -1
- package/build/dist/chunks/{N77ANGBT.js → 4X2JOQ2L.js} +1 -1
- package/build/dist/chunks/{ZPM2MFXZ.js → 52DHGSG4.js} +1 -1
- package/build/dist/chunks/{2CS3M32D.js → 57HAXNQV.js} +1 -1
- package/build/dist/chunks/5IIR3GIN.js +1 -0
- package/build/dist/chunks/{CAU44UWP.js → 5O5ZE3ZV.js} +1 -1
- package/build/dist/chunks/5OEHZJ6X.js +1 -0
- package/build/dist/chunks/{CBA776XQ.js → 5VHH5PW3.js} +1 -1
- package/build/dist/chunks/{NCEJZWGX.js → 66VBACC2.js} +1 -1
- package/build/dist/chunks/{6HV5BR7P.js → 6AWTAE4Q.js} +1 -1
- package/build/dist/chunks/{JRVTSGAT.js → 6UPPUHCL.js} +1 -1
- package/build/dist/chunks/{MEMVFR7Z.js → 6ZYLNB2B.js} +1 -1
- package/build/dist/chunks/7XLEYOZH.js +1 -0
- package/build/dist/chunks/{Q4RZQCDS.js → AAGDMH54.js} +1 -1
- package/build/dist/chunks/ACN2BFMA.js +1 -0
- package/build/dist/chunks/{L24EOVLT.js → AJP5LDM2.js} +1 -1
- package/build/dist/chunks/{F2YH72GF.js → ALK6NKFP.js} +1 -1
- package/build/dist/chunks/{EC5W3UZD.js → AMICUXS6.js} +1 -1
- package/build/dist/chunks/{5LQBHXFA.js → BX7XQANB.js} +1 -1
- package/build/dist/chunks/{QNPEKNWM.js → CEIPDEXZ.js} +1 -1
- package/build/dist/chunks/{HFQS5344.js → CQCVFRQ5.js} +1 -1
- package/build/dist/chunks/{OJLMF5AR.js → CUNQ5RG5.js} +1 -1
- package/build/dist/chunks/{IWALIX7Q.js → CXLEQCP3.js} +1 -1
- package/build/dist/chunks/{VJ3W2V3B.js → CY75R4FK.js} +1 -1
- package/build/dist/chunks/{65QFM4JU.js → DCTUYDWF.js} +1 -1
- package/build/dist/chunks/DHOBTJRD.js +1 -0
- package/build/dist/chunks/{N37ZLNCT.js → DRWWPBOQ.js} +1 -1
- package/build/dist/chunks/{7B5UH2VS.js → DZGEQBO7.js} +1 -1
- package/build/dist/chunks/{RFJCG4NA.js → E7R3J4H7.js} +1 -1
- package/build/dist/chunks/{7T4BYFD4.js → EGUMOD3A.js} +1 -1
- package/build/dist/chunks/ELZNT5Q3.js +1 -0
- package/build/dist/chunks/EPZ7SWKM.js +1 -0
- package/build/dist/chunks/{IUETZH6I.js → EXRKBBX2.js} +1 -1
- package/build/dist/chunks/{K7HIKXNT.js → FBSUTF3B.js} +1 -1
- package/build/dist/chunks/{LFN3OODW.js → FUXT7GRK.js} +1 -1
- package/build/dist/chunks/G6HCV67X.js +1 -0
- package/build/dist/chunks/{HNMOB76J.js → GGUEKSR4.js} +1 -1
- package/build/dist/chunks/{GZ5TW3WB.js → GIV5JMTE.js} +1 -1
- package/build/dist/chunks/{OMTCWXQR.js → GJY3P6OG.js} +1 -1
- package/build/dist/chunks/HOEQVPY7.js +1 -0
- package/build/dist/chunks/{3R3C3CU5.js → IBXYIN7Q.js} +1 -1
- package/build/dist/chunks/{SXX52Y27.js → IUE6RASI.js} +1 -1
- package/build/dist/chunks/J2XAEVKC.js +1 -0
- package/build/dist/chunks/{AYM5L6L7.js → J3GFCBZZ.js} +1 -1
- package/build/dist/chunks/JNZZLA2A.js +1 -0
- package/build/dist/chunks/{T3MGNKA6.js → JPOYTTTW.js} +1 -1
- package/build/dist/chunks/{AZGMF26W.js → JST5JGAP.js} +1 -1
- package/build/dist/chunks/{BG4S6MSN.js → JVI26KQO.js} +1 -1
- package/build/dist/chunks/{FBQWTWPT.js → JWCOXLYA.js} +1 -1
- package/build/dist/chunks/{G7UKNO2I.js → KHJFXJBU.js} +1 -1
- package/build/dist/chunks/{HQVC6X3T.js → KSZMMNXK.js} +1 -1
- package/build/dist/chunks/{O7PQDUVT.js → L3ZM77SJ.js} +1 -1
- package/build/dist/chunks/{QRUC7EFE.js → L62M7LOB.js} +1 -1
- package/build/dist/chunks/{22S4SFD5.js → L7YBCMZU.js} +1 -1
- package/build/dist/chunks/{H6ED3RHF.js → LMVB3B6T.js} +1 -1
- package/build/dist/chunks/{UIIJWIR6.js → LQGPMOD2.js} +1 -1
- package/build/dist/chunks/{WLACEU2Y.js → LQUDJCAR.js} +1 -1
- package/build/dist/chunks/LT5P6PZW.js +1 -0
- package/build/dist/chunks/M7U3A4EH.js +3 -0
- package/build/dist/chunks/MFNP4KOK.js +1 -0
- package/build/dist/chunks/MKQVS3IO.js +1 -0
- package/build/dist/chunks/{7US6PD56.js → MLPWQTBS.js} +1 -1
- package/build/dist/chunks/{5XFXH2JT.js → NATG6YA6.js} +1 -1
- package/build/dist/chunks/{O47JXRXN.js → NAYRD43N.js} +1 -1
- package/build/dist/chunks/{6L6DSMCU.js → NMYGNJIJ.js} +1 -1
- package/build/dist/chunks/NRBIXV7V.js +1 -0
- package/build/dist/chunks/{D6VP3N27.js → NSOEDRBU.js} +1 -1
- package/build/dist/chunks/{HL2MLC3O.js → NU4K3TEZ.js} +1 -1
- package/build/dist/chunks/NWSPC3NH.js +1 -0
- package/build/dist/chunks/{I7NUTSSX.js → OE3CLZHR.js} +1 -1
- package/build/dist/chunks/{2NA6JLEC.js → OQVZVR2S.js} +1 -1
- package/build/dist/chunks/{D3OWLDVB.js → OVK4EEOD.js} +1 -1
- package/build/dist/chunks/{Q2VMH2LB.js → PARWLWXW.js} +1 -1
- package/build/dist/chunks/{DHXVYHT4.js → PTAWEHKB.js} +1 -1
- package/build/dist/chunks/{DVKDWXEJ.js → PWBL4WKB.js} +1 -1
- package/build/dist/chunks/{PR2QED25.js → PZHR4ITH.js} +1 -1
- package/build/dist/chunks/{JG24LNUI.js → Q356HHCL.js} +1 -1
- package/build/dist/chunks/{OG5HRQU4.js → QRDDKA4I.js} +1 -1
- package/build/dist/chunks/{YR3QJVJQ.js → QXNPPCOU.js} +1 -1
- package/build/dist/chunks/{6NR7SVRO.js → QYYFRAWY.js} +1 -1
- package/build/dist/chunks/{QR7ALOR4.js → R53P2K3C.js} +1 -1
- package/build/dist/chunks/{5RKWSFD2.js → R7FXNZRM.js} +1 -1
- package/build/dist/chunks/{CCEWSOBT.js → R7QPJQP6.js} +1 -1
- package/build/dist/chunks/{SLSPWXR6.js → R7SXC74O.js} +1 -1
- package/build/dist/chunks/{IHGVCPVA.js → RAKUK5VR.js} +1 -1
- package/build/dist/chunks/{7LDAJ6BM.js → S3HNPTXA.js} +1 -1
- package/build/dist/chunks/SI6GCOAS.js +1 -0
- package/build/dist/chunks/{WIDTTGSH.js → SJPM5ST4.js} +1 -1
- package/build/dist/chunks/{QYHJWU5T.js → SJPYXNOK.js} +1 -1
- package/build/dist/chunks/{VY3P34PY.js → SKQGLGES.js} +1 -1
- package/build/dist/chunks/{ZT67OMLW.js → SOYQOE5P.js} +1 -1
- package/build/dist/chunks/{GUBB5P6V.js → SQZRVIVF.js} +1 -1
- package/build/dist/chunks/{E24S22BZ.js → SSTROLQM.js} +1 -1
- package/build/dist/chunks/{DGGOO4RN.js → SXAIXD56.js} +1 -1
- package/build/dist/chunks/{D4WURN33.js → SXX3VTBP.js} +1 -1
- package/build/dist/chunks/{UXG67LH3.js → TCPPYBGQ.js} +1 -1
- package/build/dist/chunks/TFVWAYHY.js +1 -0
- package/build/dist/chunks/{67TJOOBI.js → TLJPVYRJ.js} +1 -1
- package/build/dist/chunks/{ULJ6E4HP.js → TMGWXDCZ.js} +1 -1
- package/build/dist/chunks/{NMFVXBTL.js → TNSKEHPC.js} +1 -1
- package/build/dist/chunks/{C2FEXLMA.js → TQL7UDFL.js} +1 -1
- package/build/dist/chunks/{QXFJZGVB.js → TWCSCRFS.js} +1 -1
- package/build/dist/chunks/{2EDXKJ3B.js → TWSTOFN3.js} +1 -1
- package/build/dist/chunks/{X6G4BD35.js → U3F6DDML.js} +1 -1
- package/build/dist/chunks/{XGUKLFBU.js → UFS2RVEZ.js} +1 -1
- package/build/dist/chunks/{RM5W63LO.js → UNZRE3YU.js} +1 -1
- package/build/dist/chunks/{GECX5U3F.js → USSOVTD5.js} +1 -1
- package/build/dist/chunks/V2OOOV6B.js +1 -0
- package/build/dist/chunks/{IRWEY7TQ.js → V5LTA42G.js} +1 -1
- package/build/dist/chunks/{TAI63P6E.js → VC2RCYQE.js} +1 -1
- package/build/dist/chunks/{3ZVGHC6S.js → VFSRRDLY.js} +1 -1
- package/build/dist/chunks/{XW7RH7YY.js → VVEUJ36E.js} +1 -1
- package/build/dist/chunks/{5EHQM6DM.js → WQ6H62DM.js} +1 -1
- package/build/dist/chunks/{TDN3C4IG.js → WQQJ7UPJ.js} +1 -1
- package/build/dist/chunks/{F3TJCOVV.js → WTSMPDT5.js} +1 -1
- package/build/dist/chunks/{BYXBS45D.js → WVXW6VL3.js} +1 -1
- package/build/dist/chunks/WWFOYZT2.js +1 -0
- package/build/dist/chunks/WWNAGOCD.js +1 -0
- package/build/dist/chunks/X2NJSQUY.js +203 -0
- package/build/dist/chunks/{FKAA7VUR.js → XMA25DXR.js} +1 -1
- package/build/dist/chunks/{C3ZZSGSP.js → XQUPZ3GU.js} +1 -1
- package/build/dist/chunks/XQXLFF7Y.js +1 -0
- package/build/dist/chunks/XV2HQKND.js +1 -0
- package/build/dist/chunks/{QZM7CWZW.js → XVFLT275.js} +1 -1
- package/build/dist/chunks/{BV3AHLH5.js → XWEFKXKA.js} +1 -1
- package/build/dist/chunks/{BEPSWFJX.js → Y2KH6DCE.js} +1 -1
- package/build/dist/chunks/{NKY3DT34.js → YA5WWDEW.js} +1 -1
- package/build/dist/chunks/YHB55C5T.js +1 -0
- package/build/dist/chunks/YQUKU2LS.js +1 -0
- package/build/dist/chunks/{72AWP4BM.js → YZSTP2E6.js} +1 -1
- package/build/dist/chunks/{T3NPRRTY.js → Z7RL4NGX.js} +1 -1
- package/build/dist/chunks/{YMB553OJ.js → ZT47KN7A.js} +1 -1
- package/build/dist/chunks/{NUTHT4FE.js → ZUG6MG46.js} +1 -1
- package/package.json +1 -1
- package/build/dist/chunks/6SCCW74G.js +0 -1
- package/build/dist/chunks/DD7755AW.js +0 -1
- package/build/dist/chunks/EYYUWFUR.js +0 -1
- package/build/dist/chunks/JRO6WTK4.js +0 -1
- package/build/dist/chunks/MNFU7PO3.js +0 -1
- package/build/dist/chunks/N3GWFLG6.js +0 -1
- package/build/dist/chunks/UMK564HS.js +0 -1
- package/build/dist/chunks/XPFVT2EA.js +0 -1
- package/build/dist/chunks/XUJSQV52.js +0 -1
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
var e=`
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
203
|
+
`,n="https://github.com/runningoffcode/agent-wormhole/tree/603aba277a626630d9b9463f713121dc4327325c";export{e as a,n as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as _,e as oe,f as M,h as te,i as N}from"./3R3C3CU5.js";import{E as P,a as Z,b as J,c as v,f as C,h as b,m as A,q as x,s as Q,u as ee}from"./JG24LNUI.js";import{f as D,g as Y}from"./MEMVFR7Z.js";import{a as $}from"./VJ3W2V3B.js";import{a as G}from"./6IM6A5VA.js";import{g as S}from"./73N3TOJL.js";import{a as w}from"./XPFVT2EA.js";import{a as k,b as X,d as j}from"./5YS5V2LK.js";import{decodeAbiParameters as fe,getAddress as y,pad as se,parseAbi as ae,parseAbiParameters as me,toEventSelector as he,toHex as ne,zeroAddress as de}from"viem";var ge=he("Initialize(bytes32,address,address,uint24,int24,address,uint160,int24)"),ke=me("uint24 fee, int24 tickSpacing, address hooks, uint160 sqrtPriceX96, int24 tick"),V=10000000n,ce=25,H=200,L=16,we=3e3,Pe=500,ye=500n,E=100,B=ae(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)","function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)"]),be=ae(["function poolKeys(bytes25 poolId) view returns (address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks)"]);function Ae(o){let e=o.trim().toLowerCase();return e==="eth"||e==="native"||e===de||e===$.toLowerCase()}function ie(o,e){if(o!=null){if(typeof o!="string")throw new k(`${e} must be a token address, or "eth" for native ETH.`);return Ae(o)?{eth:!0}:(G(o),{eth:!1,address:y(o)})}}var le=(o,e)=>BigInt(o)<BigInt(e)?-1:BigInt(o)>BigInt(e)?1:0;function T(o){return{address:o.address,symbol:o.symbol,decimals:o.decimals}}async function ue(o,e,r,i,d){let[t,n,u]=await Promise.all([o.readContract({address:e,abi:N,functionName:"slot0"}),o.readContract({address:e,abi:N,functionName:"liquidity"}),o.readContract({address:e,abi:N,functionName:"tickSpacing"})]),s=BigInt(t[0]);return{version:"v3",id:e,token0:T(r),token1:T(i),fee:d,tickSpacing:Number(u),initialized:s>0n,liquidity:BigInt(n).toString(),sqrtPriceX96:s.toString(),tick:Number(t[1]),price:s>0n?D(s,r.decimals,i.decimals):"0",addSupported:!0}}async function q(o,e,r){let i=r??Q(e),[d,t]=await Promise.all([P(o,e.currency0,w),P(o,e.currency1,w)]),[n,u]=await Promise.all([o.readContract({address:v,abi:B,functionName:"getSlot0",args:[i]}),o.readContract({address:v,abi:B,functionName:"getLiquidity",args:[i]})]),s=BigInt(n[0]),m=ee(e,Number(n[3]));return{version:"v4",id:i,token0:T(d),token1:T(t),fee:e.fee,tickSpacing:e.tickSpacing,hooks:y(e.hooks),initialized:s>0n,liquidity:BigInt(u).toString(),sqrtPriceX96:s.toString(),tick:Number(n[1]),price:s>0n?D(s,d.decimals,t.decimals):"0",addSupported:x.has(e.hooks.toLowerCase()),feeNote:m.feeNote,...x.has(e.hooks.toLowerCase())?{}:{note:`Hook ${y(e.hooks)} is not one Oak has measured, so uniswap_add will refuse this pool.`}}}async function Ie(o,e,r){let i=await o.getBlockNumber(),d=new Map;for(let t=0n;t<=i;t+=V){let n=t+V-1n<i?t+V-1n:i,u=await o.request({method:"eth_getLogs",params:[{address:Z.toLowerCase(),topics:[ge,null,e?se(e):null,r?se(r):null],fromBlock:ne(t),toBlock:ne(n)}]});if(!Array.isArray(u))throw new k("Invalid v4 Initialize log response.");for(let s of u){if(!Array.isArray(s.topics)||s.topics.length!==4||typeof s.data!="string")throw new k("Invalid v4 Initialize log.");let[m,a,p]=fe(ke,s.data),h={currency0:y(`0x${s.topics[2].slice(-40)}`),currency1:y(`0x${s.topics[3].slice(-40)}`),fee:Number(m),tickSpacing:Number(a),hooks:y(p)};d.set(s.topics[1].toLowerCase(),{key:h,id:s.topics[1]})}}return[...d.values()]}async function ve(o,e,r){let i=e.eth?_.weth:e.address,d=r.eth?_.weth:r.address;if(i===d)return[];let[t,n]=le(i,d)<0?[i,d]:[d,i],[u,s]=await Promise.all([P(o,t,w),P(o,n,w)]),m=[];for(let a of Object.keys(oe).map(Number)){let p=y(String(await o.readContract({address:_.factory,abi:te,functionName:"getPool",args:[t,n,a]})));p!==de&&m.push(await ue(o,p,u,s,a))}return m}function re(o){return o?o.eth?[b,C]:o.address===C?[C,b]:[o.address]:null}async function Ce(o,e){let r=new Map;if(e.length===0)return r;if(typeof o.multicall=="function"&&o.chain?.contracts?.multicall3)try{return(await o.multicall({allowFailure:!0,contracts:e.map(d=>({address:v,abi:B,functionName:"getLiquidity",args:[d]}))})).forEach((d,t)=>r.set(e[t].toLowerCase(),d.status==="success"?BigInt(d.result):0n)),r}catch{}for(let i=0;i<e.length;i+=L)(await Promise.allSettled(e.slice(i,i+L).map(async t=>BigInt(await o.readContract({address:v,abi:B,functionName:"getLiquidity",args:[t]}))))).forEach((t,n)=>r.set(e[i+n].toLowerCase(),t.status==="fulfilled"?t.value:0n));return r}async function Se(o,e,r,i){let d=re(e),t=re(r),n=new Map,u=(c,f)=>{if(c&&f){if(c===f)return;let[l,g]=le(c,f)<0?[c,f]:[f,c];n.set(`${l}/${g}`,[l,g])}else if(c||f){let l=c??f;n.set(`${l}/*0`,[l,null]),n.set(`${l}/*1`,[null,l])}};for(let c of d??[null])for(let f of t??[null])u(c,f);let s=new Map;for(let c of A)[...n.values()].some(([l,g])=>(!l||S(c.key.currency0,l))&&(!g||S(c.key.currency1,g)))&&s.set(c.poolId.toLowerCase(),{key:c.key,id:c.poolId});for(let[c,f]of n.values())for(let l of await Ie(o,c,f))s.set(l.id.toLowerCase(),l);let m=new Set(A.map(c=>c.poolId.toLowerCase())),a=[...s.values()],p=a.filter(c=>m.has(c.id.toLowerCase())),h=a.filter(c=>!m.has(c.id.toLowerCase())).reverse(),I=typeof o.multicall=="function"&&!!o.chain?.contracts?.multicall3?we:Pe;h.length>I&&i.push(`${h.length} v4 pools match; only the newest ${I} non-measured ones were considered. Pass both tokens, or a poolId, to narrow.`);let U=h.slice(0,I),z=await Ce(o,U.map(c=>c.id)),pe=U.sort((c,f)=>{let l=z.get(c.id.toLowerCase())??0n,g=z.get(f.id.toLowerCase())??0n;return l===g?0:l<g?1:-1}),R=[...p,...pe];R.length>H&&i.push(`${R.length} v4 pools match; full state was read for Oak's measured pools plus the deepest of the rest (${H} total). Pass both tokens, or a poolId, to narrow.`);let K=[],O=0,W=R.slice(0,H);for(let c=0;c<W.length;c+=L){let f=await Promise.allSettled(W.slice(c,c+L).map(({key:l,id:g})=>q(o,l,g)));for(let l of f)l.status==="fulfilled"?K.push(l.value):O++}return O>0&&i.push(`${O} pool(s) were skipped because a token or pool state could not be read.`),K}async function _e(o,e){let r=A.find(s=>S(s.poolId,e));if(r)return q(o,r.key,r.poolId);let[i,d,t,n,u]=await o.readContract({address:J,abi:be,functionName:"poolKeys",args:[e.slice(0,52)]});if(i===b&&d===b&&Number(n)===0)throw new k(`No Uniswap v4 pool ${e} is known to the PositionManager (no position was ever minted in it, or it is not initialized). Search by token pair instead.`);return q(o,{currency0:i,currency1:d,fee:Number(t),tickSpacing:Number(n),hooks:u},e)}function Ne(o){let e=new Set([...A.map(t=>t.poolId.toLowerCase()),...M.map(t=>t.address.toLowerCase())]),r=new Set([b,$.toLowerCase(),C.toLowerCase()]),i=t=>r.has(t.address.toLowerCase())?"ETH":t.address.toLowerCase(),d=new Map;for(let t of o.filter(n=>n.initialized&&BigInt(n.liquidity)>0n)){let n=`${i(t.token0)}/${i(t.token1)}`;d.set(n,[...d.get(n)??[],t])}for(let t of d.values()){let n=t.filter(a=>e.has(a.id.toLowerCase()));if(n.length===0&&t.length<3)continue;let s=(n.length>0?n:t).map(a=>BigInt(a.sqrtPriceX96)).sort((a,p)=>a<p?-1:a>p?1:0),m=s[Math.floor(s.length/2)];for(let a of t){if(e.has(a.id.toLowerCase()))continue;let p=Y(BigInt(a.sqrtPriceX96),m);p>ye&&(a.priceOutlierBps=Number(p),a.note=`${a.note?`${a.note} `:""}Price differs ${p} bps from the ${n.length>0?"Oak-measured":"median"} price for this pair; do not treat this pool as the market price.`)}}}async function Ee(o,e){let r=e.version;if(r!==void 0&&r!=="v3"&&r!=="v4")throw new k('version must be "v3" or "v4"; omit it to search both.');let i=e.limit===void 0?ce:Number(e.limit);if(!Number.isInteger(i)||i<1||i>E)throw new k(`limit must be an integer from 1 to ${E}.`);let d=ie(e.tokenA,"tokenA"),t=ie(e.tokenB,"tokenB");if(!d&&t)throw new k("Provide tokenA when searching by token; tokenB narrows the search to a pair.");let n=o.clientFor(w),u=[],s=[];if(e.poolId!==void 0){if(typeof e.poolId!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e.poolId))throw new k("poolId must be a 32-byte hex v4 poolId. For v3 search by tokenA/tokenB.");s=[await _e(n,e.poolId)]}else if(d){if(r!=="v4"&&(t?s.push(...await ve(n,d,t)):u.push("v3 pools are looked up per pair; pass tokenB to include them.")),r!=="v3")try{s.push(...await Se(n,d,t,u))}catch(a){throw X(a,-32601)?a:new k(`Could not search v4 pools. ${j(a)}`)}}else{u.push("No token filter given: showing the pools Oak has measured. Pass tokenA (and tokenB) to search the chain for every pool of a pair.");let a=await Promise.all(M.map(async h=>{let[F,I]=await Promise.all([P(n,h.token0,w),P(n,h.token1,w)]);return ue(n,h.address,F,I,h.fee)})),p=await Promise.all(A.map(h=>q(n,h.key,h.poolId)));s=[...r==="v4"?[]:a,...r==="v3"?[]:p]}Ne(s),s.sort((a,p)=>BigInt(p.liquidity)>BigInt(a.liquidity)?1:BigInt(p.liquidity)<BigInt(a.liquidity)?-1:0),s.length>i&&u.push(`Showing the ${i} deepest of ${s.length} pools found; raise limit (max ${E}) to see more.`),s=s.slice(0,i);let m=s.filter(a=>a.initialized&&BigInt(a.liquidity)>0n).length;return s.length===0&&u.push("No pool exists for this pair. Create one with uniswap_create_pool, or create it and add the first liquidity together with uniswap_add plus initialPrice."),{pools:s,notes:u,summary:`Found ${s.length} Uniswap pool(s), ${m} with active liquidity. price is token1 per 1 token0.`}}function Me(o){return{tools:[{name:"uniswap_pools",inputSchema:{type:"object",description:"Read-only pool discovery on Robinhood Chain (4663): every Uniswap v3 and v4 pool for a token pair with fee, tick spacing, hook, liquidity and price, or one v4 pool by poolId. No tokens given: the measured pools.",properties:{version:{type:"string",enum:["v3","v4"],description:"Limit to one version; omit to search both."},tokenA:{type:"string",description:'Token address, or "eth" for native ETH (searches v3 WETH and v4 native/WETH pools).'},tokenB:{type:"string",description:"Second token of the pair. Required for v3 lookups."},poolId:{type:"string",description:"32-byte v4 poolId to inspect."},limit:{type:"integer",minimum:1,maximum:E,default:ce}}},execute:async r=>Ee(o,r)}]}}export{Ee as a,Me as b};
|
|
1
|
+
import{d as _,e as oe,f as M,h as te,i as N}from"./IBXYIN7Q.js";import{E as P,a as Z,b as J,c as v,f as C,h as b,m as A,q as x,s as Q,u as ee}from"./Q356HHCL.js";import{f as D,g as Y}from"./6ZYLNB2B.js";import{a as $}from"./CY75R4FK.js";import{a as G}from"./6IM6A5VA.js";import{g as S}from"./73N3TOJL.js";import{a as w}from"./G6HCV67X.js";import{a as k,b as X,d as j}from"./5YS5V2LK.js";import{decodeAbiParameters as fe,getAddress as y,pad as se,parseAbi as ae,parseAbiParameters as me,toEventSelector as he,toHex as ne,zeroAddress as de}from"viem";var ge=he("Initialize(bytes32,address,address,uint24,int24,address,uint160,int24)"),ke=me("uint24 fee, int24 tickSpacing, address hooks, uint160 sqrtPriceX96, int24 tick"),V=10000000n,ce=25,H=200,L=16,we=3e3,Pe=500,ye=500n,E=100,B=ae(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)","function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)"]),be=ae(["function poolKeys(bytes25 poolId) view returns (address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks)"]);function Ae(o){let e=o.trim().toLowerCase();return e==="eth"||e==="native"||e===de||e===$.toLowerCase()}function ie(o,e){if(o!=null){if(typeof o!="string")throw new k(`${e} must be a token address, or "eth" for native ETH.`);return Ae(o)?{eth:!0}:(G(o),{eth:!1,address:y(o)})}}var le=(o,e)=>BigInt(o)<BigInt(e)?-1:BigInt(o)>BigInt(e)?1:0;function T(o){return{address:o.address,symbol:o.symbol,decimals:o.decimals}}async function ue(o,e,r,i,d){let[t,n,u]=await Promise.all([o.readContract({address:e,abi:N,functionName:"slot0"}),o.readContract({address:e,abi:N,functionName:"liquidity"}),o.readContract({address:e,abi:N,functionName:"tickSpacing"})]),s=BigInt(t[0]);return{version:"v3",id:e,token0:T(r),token1:T(i),fee:d,tickSpacing:Number(u),initialized:s>0n,liquidity:BigInt(n).toString(),sqrtPriceX96:s.toString(),tick:Number(t[1]),price:s>0n?D(s,r.decimals,i.decimals):"0",addSupported:!0}}async function q(o,e,r){let i=r??Q(e),[d,t]=await Promise.all([P(o,e.currency0,w),P(o,e.currency1,w)]),[n,u]=await Promise.all([o.readContract({address:v,abi:B,functionName:"getSlot0",args:[i]}),o.readContract({address:v,abi:B,functionName:"getLiquidity",args:[i]})]),s=BigInt(n[0]),m=ee(e,Number(n[3]));return{version:"v4",id:i,token0:T(d),token1:T(t),fee:e.fee,tickSpacing:e.tickSpacing,hooks:y(e.hooks),initialized:s>0n,liquidity:BigInt(u).toString(),sqrtPriceX96:s.toString(),tick:Number(n[1]),price:s>0n?D(s,d.decimals,t.decimals):"0",addSupported:x.has(e.hooks.toLowerCase()),feeNote:m.feeNote,...x.has(e.hooks.toLowerCase())?{}:{note:`Hook ${y(e.hooks)} is not one Oak has measured, so uniswap_add will refuse this pool.`}}}async function Ie(o,e,r){let i=await o.getBlockNumber(),d=new Map;for(let t=0n;t<=i;t+=V){let n=t+V-1n<i?t+V-1n:i,u=await o.request({method:"eth_getLogs",params:[{address:Z.toLowerCase(),topics:[ge,null,e?se(e):null,r?se(r):null],fromBlock:ne(t),toBlock:ne(n)}]});if(!Array.isArray(u))throw new k("Invalid v4 Initialize log response.");for(let s of u){if(!Array.isArray(s.topics)||s.topics.length!==4||typeof s.data!="string")throw new k("Invalid v4 Initialize log.");let[m,a,p]=fe(ke,s.data),h={currency0:y(`0x${s.topics[2].slice(-40)}`),currency1:y(`0x${s.topics[3].slice(-40)}`),fee:Number(m),tickSpacing:Number(a),hooks:y(p)};d.set(s.topics[1].toLowerCase(),{key:h,id:s.topics[1]})}}return[...d.values()]}async function ve(o,e,r){let i=e.eth?_.weth:e.address,d=r.eth?_.weth:r.address;if(i===d)return[];let[t,n]=le(i,d)<0?[i,d]:[d,i],[u,s]=await Promise.all([P(o,t,w),P(o,n,w)]),m=[];for(let a of Object.keys(oe).map(Number)){let p=y(String(await o.readContract({address:_.factory,abi:te,functionName:"getPool",args:[t,n,a]})));p!==de&&m.push(await ue(o,p,u,s,a))}return m}function re(o){return o?o.eth?[b,C]:o.address===C?[C,b]:[o.address]:null}async function Ce(o,e){let r=new Map;if(e.length===0)return r;if(typeof o.multicall=="function"&&o.chain?.contracts?.multicall3)try{return(await o.multicall({allowFailure:!0,contracts:e.map(d=>({address:v,abi:B,functionName:"getLiquidity",args:[d]}))})).forEach((d,t)=>r.set(e[t].toLowerCase(),d.status==="success"?BigInt(d.result):0n)),r}catch{}for(let i=0;i<e.length;i+=L)(await Promise.allSettled(e.slice(i,i+L).map(async t=>BigInt(await o.readContract({address:v,abi:B,functionName:"getLiquidity",args:[t]}))))).forEach((t,n)=>r.set(e[i+n].toLowerCase(),t.status==="fulfilled"?t.value:0n));return r}async function Se(o,e,r,i){let d=re(e),t=re(r),n=new Map,u=(c,f)=>{if(c&&f){if(c===f)return;let[l,g]=le(c,f)<0?[c,f]:[f,c];n.set(`${l}/${g}`,[l,g])}else if(c||f){let l=c??f;n.set(`${l}/*0`,[l,null]),n.set(`${l}/*1`,[null,l])}};for(let c of d??[null])for(let f of t??[null])u(c,f);let s=new Map;for(let c of A)[...n.values()].some(([l,g])=>(!l||S(c.key.currency0,l))&&(!g||S(c.key.currency1,g)))&&s.set(c.poolId.toLowerCase(),{key:c.key,id:c.poolId});for(let[c,f]of n.values())for(let l of await Ie(o,c,f))s.set(l.id.toLowerCase(),l);let m=new Set(A.map(c=>c.poolId.toLowerCase())),a=[...s.values()],p=a.filter(c=>m.has(c.id.toLowerCase())),h=a.filter(c=>!m.has(c.id.toLowerCase())).reverse(),I=typeof o.multicall=="function"&&!!o.chain?.contracts?.multicall3?we:Pe;h.length>I&&i.push(`${h.length} v4 pools match; only the newest ${I} non-measured ones were considered. Pass both tokens, or a poolId, to narrow.`);let U=h.slice(0,I),z=await Ce(o,U.map(c=>c.id)),pe=U.sort((c,f)=>{let l=z.get(c.id.toLowerCase())??0n,g=z.get(f.id.toLowerCase())??0n;return l===g?0:l<g?1:-1}),R=[...p,...pe];R.length>H&&i.push(`${R.length} v4 pools match; full state was read for Oak's measured pools plus the deepest of the rest (${H} total). Pass both tokens, or a poolId, to narrow.`);let K=[],O=0,W=R.slice(0,H);for(let c=0;c<W.length;c+=L){let f=await Promise.allSettled(W.slice(c,c+L).map(({key:l,id:g})=>q(o,l,g)));for(let l of f)l.status==="fulfilled"?K.push(l.value):O++}return O>0&&i.push(`${O} pool(s) were skipped because a token or pool state could not be read.`),K}async function _e(o,e){let r=A.find(s=>S(s.poolId,e));if(r)return q(o,r.key,r.poolId);let[i,d,t,n,u]=await o.readContract({address:J,abi:be,functionName:"poolKeys",args:[e.slice(0,52)]});if(i===b&&d===b&&Number(n)===0)throw new k(`No Uniswap v4 pool ${e} is known to the PositionManager (no position was ever minted in it, or it is not initialized). Search by token pair instead.`);return q(o,{currency0:i,currency1:d,fee:Number(t),tickSpacing:Number(n),hooks:u},e)}function Ne(o){let e=new Set([...A.map(t=>t.poolId.toLowerCase()),...M.map(t=>t.address.toLowerCase())]),r=new Set([b,$.toLowerCase(),C.toLowerCase()]),i=t=>r.has(t.address.toLowerCase())?"ETH":t.address.toLowerCase(),d=new Map;for(let t of o.filter(n=>n.initialized&&BigInt(n.liquidity)>0n)){let n=`${i(t.token0)}/${i(t.token1)}`;d.set(n,[...d.get(n)??[],t])}for(let t of d.values()){let n=t.filter(a=>e.has(a.id.toLowerCase()));if(n.length===0&&t.length<3)continue;let s=(n.length>0?n:t).map(a=>BigInt(a.sqrtPriceX96)).sort((a,p)=>a<p?-1:a>p?1:0),m=s[Math.floor(s.length/2)];for(let a of t){if(e.has(a.id.toLowerCase()))continue;let p=Y(BigInt(a.sqrtPriceX96),m);p>ye&&(a.priceOutlierBps=Number(p),a.note=`${a.note?`${a.note} `:""}Price differs ${p} bps from the ${n.length>0?"Oak-measured":"median"} price for this pair; do not treat this pool as the market price.`)}}}async function Ee(o,e){let r=e.version;if(r!==void 0&&r!=="v3"&&r!=="v4")throw new k('version must be "v3" or "v4"; omit it to search both.');let i=e.limit===void 0?ce:Number(e.limit);if(!Number.isInteger(i)||i<1||i>E)throw new k(`limit must be an integer from 1 to ${E}.`);let d=ie(e.tokenA,"tokenA"),t=ie(e.tokenB,"tokenB");if(!d&&t)throw new k("Provide tokenA when searching by token; tokenB narrows the search to a pair.");let n=o.clientFor(w),u=[],s=[];if(e.poolId!==void 0){if(typeof e.poolId!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e.poolId))throw new k("poolId must be a 32-byte hex v4 poolId. For v3 search by tokenA/tokenB.");s=[await _e(n,e.poolId)]}else if(d){if(r!=="v4"&&(t?s.push(...await ve(n,d,t)):u.push("v3 pools are looked up per pair; pass tokenB to include them.")),r!=="v3")try{s.push(...await Se(n,d,t,u))}catch(a){throw X(a,-32601)?a:new k(`Could not search v4 pools. ${j(a)}`)}}else{u.push("No token filter given: showing the pools Oak has measured. Pass tokenA (and tokenB) to search the chain for every pool of a pair.");let a=await Promise.all(M.map(async h=>{let[F,I]=await Promise.all([P(n,h.token0,w),P(n,h.token1,w)]);return ue(n,h.address,F,I,h.fee)})),p=await Promise.all(A.map(h=>q(n,h.key,h.poolId)));s=[...r==="v4"?[]:a,...r==="v3"?[]:p]}Ne(s),s.sort((a,p)=>BigInt(p.liquidity)>BigInt(a.liquidity)?1:BigInt(p.liquidity)<BigInt(a.liquidity)?-1:0),s.length>i&&u.push(`Showing the ${i} deepest of ${s.length} pools found; raise limit (max ${E}) to see more.`),s=s.slice(0,i);let m=s.filter(a=>a.initialized&&BigInt(a.liquidity)>0n).length;return s.length===0&&u.push("No pool exists for this pair. Create one with uniswap_create_pool, or create it and add the first liquidity together with uniswap_add plus initialPrice."),{pools:s,notes:u,summary:`Found ${s.length} Uniswap pool(s), ${m} with active liquidity. price is token1 per 1 token0.`}}function Me(o){return{tools:[{name:"uniswap_pools",inputSchema:{type:"object",description:"Read-only pool discovery on Robinhood Chain (4663): every Uniswap v3 and v4 pool for a token pair with fee, tick spacing, hook, liquidity and price, or one v4 pool by poolId. No tokens given: the measured pools.",properties:{version:{type:"string",enum:["v3","v4"],description:"Limit to one version; omit to search both."},tokenA:{type:"string",description:'Token address, or "eth" for native ETH (searches v3 WETH and v4 native/WETH pools).'},tokenB:{type:"string",description:"Second token of the pair. Required for v3 lookups."},poolId:{type:"string",description:"32-byte v4 poolId to inspect."},limit:{type:"integer",minimum:1,maximum:E,default:ce}}},execute:async r=>Ee(o,r)}]}}export{Ee as a,Me as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as w,d as T,i as A,m as S}from"./73N3TOJL.js";import{a as c,i as k}from"./
|
|
1
|
+
import{c as w,d as T,i as A,m as S}from"./73N3TOJL.js";import{a as c,i as k}from"./G6HCV67X.js";import{a as r}from"./5YS5V2LK.js";import{encodeFunctionData as D,getAddress as E,keccak256 as P,parseAbi as O}from"viem";var g=E("0x03695edcfcf2c62a4dc36b032eb2513cd1d928a2"),I="0x0b3d9287f6788f70f8f32597eb50d8aaf791742819ecf58053f3e22fd96cb76b",F=["beefy_vault_manage"],C=O(["function owner() view returns(address)","function want() view returns(address)","function vault() view returns(address)","function strategy() view returns(address)","function approvalDelay() view returns(uint256)","function stratCandidate() view returns(address implementation,uint256 proposedTime)","function earn()","function proposeStrat(address)","function upgradeStrat()","function inCaseTokensGetStuck(address)","function transferOwnership(address)","function renounceOwnership()"]),s=E(k[c].vaults.beefyTestedLpVault.address);function d(u){return A(u,"Provide a contract or wallet address.",T)}function h(u){return S(u,"Invalid Beefy administration integer.")}var R=u=>{async function v(e){try{return await e()}catch(t){throw new r(u.plainError(t))}}function b(e,t){if(e.chainId!==void 0&&e.chainId!==c)throw new r("Beefy requires chain 4663.");for(let p of Object.keys(e))if(!["chainId","vault",...t].includes(p))throw new r(`Unsupported Beefy input: ${p}.`);if(d(e.vault)!==s)throw new r("Administration is qualified only for the measured up33-weth-up vault.")}async function _(){let e=u.clientFor(c);if(await e.getChainId()!==c)throw new r("The Beefy endpoint must report chain 4663.");let t=h(await e.getBlockNumber()),[p,n]=await Promise.all([e.getCode({address:s,blockNumber:t}),e.getCode({address:g,blockNumber:t})]),o=`0x363d3d373d3d3d363d73${g.slice(2).toLowerCase()}5af43d82803e903d91602b57fd5bf3`;if(p?.toLowerCase()!==o||!n||P(n)!==I)throw new r("The Beefy vault implementation no longer matches its qualified code hash.");let a=(B,N)=>e.readContract({address:B,abi:C,functionName:N,blockNumber:t}),[f,m,y,i,l,x]=await Promise.all([a(s,"owner"),a(s,"want"),a(s,"strategy"),a(s,"approvalDelay"),a(s,"stratCandidate"),e.getBlock({blockNumber:t})]);if(!Array.isArray(l)||l.length!==2)throw new r("Invalid Beefy strategy candidate.");return{client:e,blockNumber:t,owner:d(f),want:d(m),strategy:d(y),approvalDelay:h(i),candidate:{implementation:d(l[0]),proposedTime:h(l[1])},timestamp:h(x.timestamp),read:a}}return{tools:[{name:"beefy_vault_admin",inputSchema:{type:"object",properties:{vault:w,chainId:{const:c}},required:["vault"],additionalProperties:!1},execute:e=>v(async()=>{b(e,[]);let t=await _();return{vault:s,chainId:c,owner:t.owner,want:t.want,strategy:t.strategy,candidate:{implementation:t.candidate.implementation,proposedTime:t.candidate.proposedTime.toString()},approvalDelay:t.approvalDelay.toString(),block:t.blockNumber.toString(),implementation:g,codeHash:I}})},{name:"beefy_vault_manage",inputSchema:{type:"object",properties:{vault:w,action:{enum:["earn","propose_strategy","upgrade_strategy","rescue_tokens","transfer_ownership","renounce_ownership"]},strategy:w,token:w,recipient:w,chainId:{const:c}},required:["vault","action"],additionalProperties:!1},execute:(e,t)=>v(async()=>{let p={earn:[],propose_strategy:["strategy"],upgrade_strategy:[],rescue_tokens:["token"],transfer_ownership:["recipient"],renounce_ownership:[]},n=String(e.action);if(!Object.hasOwn(p,n))throw new r("Choose a documented Beefy vault management action.");b(e,["action",...p[n]]),t=d(t);let o=await _();if(n!=="earn"&&o.owner!==t)throw new r("This wallet is not the Beefy vault owner.");let a,f=[];if(n==="earn")a="earn";else if(n==="propose_strategy"){let i=d(e.strategy),l=await o.client.getCode({address:i,blockNumber:o.blockNumber});if(!l||l==="0x"||d(await o.read(i,"vault"))!==s||d(await o.read(i,"want"))!==o.want)throw new r("The proposed strategy must be deployed for this exact vault and want token.");a="proposeStrat",f=[i]}else if(n==="upgrade_strategy"){if(o.candidate.implementation==="0x0000000000000000000000000000000000000000"||o.candidate.proposedTime+o.approvalDelay>=o.timestamp)throw new r("Propose a strategy first and wait until the on-chain approval delay has fully passed.");a="upgradeStrat"}else if(n==="rescue_tokens"){let i=d(e.token);if(i===o.want)throw new r("The vault owner cannot rescue the want token.");a="inCaseTokensGetStuck",f=[i]}else if(n==="transfer_ownership"){let i=d(e.recipient);if(i==="0x0000000000000000000000000000000000000000")throw new r("Ownership transfer needs a nonzero recipient.");a="transferOwnership",f=[i]}else a="renounceOwnership";let m=[u.unsignedTx({to:s,data:D({abi:C,functionName:a,args:f}),value:"0",chainId:c,description:`Beefy vault ${n}.`})],y=n==="renounce_ownership"?" This permanently gives up owner administration.":n==="rescue_tokens"?" Rescued tokens go to the calling owner wallet; want is excluded.":n==="propose_strategy"||n==="upgrade_strategy"?" Strategy changes affect all vault depositors.":"";return{txs:m,inputs:[],preview:await u.preview(m,t),summary:`Beefy vault action ${n} on ${s}.${y} Inspect the preview before local human confirmation.`}})}]}};export{g as a,I as b,F as c,C as d,R as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as h}from"./73N3TOJL.js";import{a as e}from"./5YS5V2LK.js";import{getAddress as y,isAddress as m,keccak256 as E,toBytes as _}from"viem";var l={source:"https://heyresearch.xyz/openapi.json",retrievedAt:"2026-11-02T21:21:26Z",sha256:"789fdd4f67e290e4c75f6c5992041a465b57dd55fa8d4ac5d4136a7145095ffa",note:"Excerpt of two operations only. No other operation is described here; the 55-operation catalogue.json keeps its own older pin.",operations:[{operation:"getProofOfShipShips",path:"/api/v1/proof-of-ship/ships",summary:"The ships HEY counts for a project in a closed window, unsigned",parameters:[{name:"slug",in:"query",required:!0,schema:{type:"string",pattern:"^[a-z0-9][a-z0-9-]{0,79}$",maxLength:80,minLength:1}},{name:"since",in:"query",required:!0,schema:{type:"integer",minimum:0}},{name:"until",in:"query",required:!0,schema:{type:"integer",minimum:0}}],format:"json",response:{type:"object",required:["slug","currentSlug","since","until","ships","evidenceIds","evidenceUrls","evidenceHash","definition"],properties:{slug:{type:"string"},currentSlug:{type:"string"},since:{type:"integer"},until:{type:"integer"},ships:{type:"integer",minimum:0},evidenceIds:{type:"array",items:{type:"string"}},evidenceUrls:{type:"array",items:{type:"string"}},evidenceHash:{type:"string",pattern:"^0x[0-9a-f]{64}$"},definition:{type:"string"}}}},{operation:"getProofOfShipTie",path:"/api/v1/proof-of-ship/tie",summary:"The payout addresses HEY would sign a Proof of Ship attestation for",parameters:[{name:"slug",in:"query",required:!0,schema:{type:"string",pattern:"^[a-z0-9][a-z0-9-]{0,79}$",maxLength:80,minLength:1}}],format:"json",response:{type:"object",required:["slug","currentSlug","payable","ties"],properties:{slug:{type:"string",description:"The slug as asked."},currentSlug:{type:"string",description:"The page's current slug."},payable:{type:"boolean",description:"Whether `ties` holds an address the attestation would accept as `builder`."},ties:{type:"array",items:{type:"object",required:["kind","address"],properties:{kind:{type:"string",enum:["wallet_claim","token_deployer"]},address:{type:"string",pattern:"^0x[0-9a-fA-F]{40}$",description:"Checksummed."}}}},reason:{type:"string",enum:["no_token","token_not_verified","issuer_token","site_disclaims_contract","site_names_another_contract","contested","no_tie"],description:"Present only when `ties` is empty."},attestationsPaused:{type:"boolean",enum:[!0],description:"Present only while the operator has paused attestations."}}}}]};var B="Builder evidence, not a trading signal. HEY Research Lab tracks builder activity only. It is not an endorsement, audit or rating.",v=["getProofOfShipShips","getProofOfShipTie"],g=/^[a-z0-9][a-z0-9-]{0,79}$/,S=/^ship:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,P=/^0x[0-9a-f]{64}$/,H=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u,k="https://heyresearch.xyz/evidence/",O=400*86400,Y=["wallet_claim","token_deployer"],x=["no_token","token_not_verified","issuer_token","site_disclaims_contract","site_names_another_contract","contested","no_tie"],I=["chain","chainId","chain_id"];function A(r){return v.includes(r)}function f(r){return typeof r=="number"&&Number.isSafeInteger(r)&&r>=0}function T(r,t,n=Math.floor(Date.now()/1e3)){if(!A(r))throw new e("Choose getProofOfShipShips or getProofOfShipTie.");if(!h(t))throw new e("Provide the documented parameters as an object.");let o=l.operations.find(i=>i.operation===r);for(let i of Object.keys(t)){if(I.includes(i))throw new e("Proof of ship reads cover Robinhood Chain mainnet (4663) only and take no chain parameter.");if(!o.parameters.some(d=>d.name===i))throw new e(`Unsupported parameter ${i} for ${r}.`)}for(let i of o.parameters)if(i.required&&t[i.name]===void 0)throw new e(`Provide ${i.name} for ${r}.`);if(typeof t.slug!="string"||!g.test(t.slug))throw new e("Provide the project slug exactly as HEY publishes it: lower-case letters, digits and hyphens, at most 80 characters.");if(r==="getProofOfShipTie")return;let{since:a,until:s}=t;if(!f(a)||!f(s))throw new e("Provide since and until as whole unix seconds.");if(s>n)throw new e("The window must have ended: until cannot be in the future.");if(a>s)throw new e("The window must start before it ends.");if(s-a>O)throw new e("The window can be at most 400 days long.")}function p(r,t){let n=r[t];if(typeof n!="string"||!g.test(n))throw new e(`HEY returned an unexpected ${t}. Please try again.`);return n}function q(r,t){if(p(t,"slug")!==r.slug)throw new e("HEY returned a different project than the one requested.");if(p(t,"currentSlug"),t.since!==r.since||t.until!==r.until)throw new e("HEY returned a different window than the one requested.");let{ships:n,evidenceIds:o,evidenceUrls:a,evidenceHash:s,definition:i}=t;if(!f(n)||!Array.isArray(o)||!Array.isArray(a))throw new e("HEY returned an unexpected ships count. Please try again.");if(!o.every(u=>typeof u=="string"&&S.test(u)))throw new e("HEY returned an evidence id that is not a ship receipt.");let d=o;if(!d.every((u,c)=>c===0||d[c-1]<u))throw new e("HEY returned evidence ids that are not sorted and unique.");if(n!==d.length)throw new e("HEY returned a ships count that does not match its evidence ids.");if(a.length!==d.length||!d.every((u,c)=>a[c]===`${k}${u}`))throw new e("HEY returned an evidence link that is not the published HEY receipt link.");if(typeof s!="string"||!P.test(s)||E(_(d.join(",")))!==s)throw new e("HEY returned an evidence hash that does not match its evidence ids.");if(typeof i!="string"||!i||H.test(i))throw new e("HEY returned an unexpected counting definition. Please try again.")}function R(r,t){if(p(t,"slug")!==r.slug)throw new e("HEY returned a different project than the one requested.");p(t,"currentSlug");let{payable:n,ties:o,reason:a,attestationsPaused:s}=t;if(typeof n!="boolean"||!Array.isArray(o))throw new e("HEY returned an unexpected tie answer. Please try again.");for(let i of o)if(!h(i)||!Y.includes(i.kind)||typeof i.address!="string"||!m(i.address,{strict:!1})||y(i.address)!==i.address)throw new e("HEY returned a tie that is not a known kind with a checksummed address.");if(n!==o.length>0)throw new e("HEY returned a payable flag that does not match its ties.");if(o.length?a!==void 0:!x.includes(a))throw new e("HEY returned an unexpected reason for the tie answer.");if(s!==void 0&&s!==!0)throw new e("HEY returned an unexpected attestation pause flag.")}function D(r,t,n,o=Math.floor(Date.now()/1e3)){if(T(r,t,o),!h(n)||!Object.keys(n).length||n.error!==void 0)throw new e("HEY returned an unexpected response. Please try again.");if(n.chainId!==void 0&&n.chainId!==4663||n.chain_id!==void 0&&n.chain_id!==4663)throw new e("HEY returned another chain.");if(n.nextCursor!=null||n.nextOffset!=null)throw new e("HEY signalled a continuation that this read does not support, so the answer may be incomplete.");r==="getProofOfShipShips"?q(t,n):R(t,n)}export{l as a,B as b,v as c,T as d,D as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as D,b as H}from"./ELZNT5Q3.js";import{a as S}from"./LT5P6PZW.js";import{a as O}from"./CY75R4FK.js";import{a as C}from"./UWOFA6GV.js";import{c as _,f as I}from"./73N3TOJL.js";import{a as d}from"./G6HCV67X.js";import{a as r}from"./5YS5V2LK.js";import{encodeFunctionData as T,erc20Abi as L,getAddress as c,parseAbi as q,zeroAddress as M}from"viem";var k={timeShares:{factory:"timeFactory",abi:[{name:"SCALE",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"MAX_ASSETS",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"MIN_LOCK_DAYS",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint32"}]},{name:"MAX_LOCK_DAYS",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint32"}]},{name:"FOREVER",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint32"}]},{name:"MAX_LOCK_AMOUNT",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"MIN_LOCK_DIVISOR",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"minLockAmount",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"MAX_TIP_BPS",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint16"}]},{name:"MIN_TIP_GROWTH",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"MAX_ISSUE_DAYS",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"MAX_CLAIM_DAYS",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"token",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"tipBps",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint16"}]},{name:"tipCap",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"assetCount",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"currencyAt",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"asset"}],outputs:[{type:"address"}]},{name:"lockedTotal",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"pendingLocks",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256",name:"amount"},{type:"uint256",name:"tick"},{type:"uint256",name:"firstLock"}]},{name:"nextDrop",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"heldAt",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"blockNumber"}],outputs:[{type:"uint256"}]},{name:"lockEpochs",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"lockId"}],outputs:[{type:"uint256",name:"joinEpoch"},{type:"uint256",name:"leaveEpoch"}]},{name:"sweepable",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"from"},{type:"uint256",name:"max"}],outputs:[{type:"uint256[]",name:"ids"},{type:"uint256",name:"next"}]},{name:"lockCount",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"lockAt",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"lockId"}],outputs:[{type:"tuple",components:[{type:"address",name:"owner"},{type:"uint64",name:"lockedAt"},{type:"uint32",name:"firstDay"},{type:"uint128",name:"amount"},{type:"uint32",name:"lastDay"},{type:"uint64",name:"unlockedAt"}]}]},{name:"isIssued",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"lockId"},{type:"uint256",name:"day"}],outputs:[{type:"bool"}]},{name:"unitSupply",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"day"}],outputs:[{type:"uint256"}]},{name:"currentDay",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"pointCount",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"pointAt",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"k"}],outputs:[{type:"uint64",name:"timestamp"},{type:"uint256[]",name:"indexes"}]},{name:"index",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"asset"}],outputs:[{type:"uint256"}]},{name:"carry",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"asset"}],outputs:[{type:"uint256"}]},{name:"pulled",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"asset"}],outputs:[{type:"uint256"}]},{name:"paid",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"asset"}],outputs:[{type:"uint256"}]},{name:"held",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"asset"}],outputs:[{type:"uint256"}]},{name:"dayIndex",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"day"},{type:"uint256",name:"asset"}],outputs:[{type:"uint256"}]},{name:"claimable",type:"function",stateMutability:"view",inputs:[{type:"address",name:"holder"},{type:"uint256",name:"day"},{type:"uint256",name:"asset"}],outputs:[{type:"uint256"}]},{name:"lockClaimable",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"lockId"},{type:"uint256",name:"asset"}],outputs:[{type:"uint256"}]},{name:"lock",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"amount"},{type:"uint32",name:"numberOfDays"}],outputs:[{type:"uint256",name:"lockId"}]},{name:"issue",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"lockId"},{type:"uint256",name:"day"},{type:"address",name:"to"}],outputs:[]},{name:"issueRange",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"lockId"},{type:"uint256",name:"firstDay"},{type:"uint256",name:"lastDay"},{type:"address",name:"to"}],outputs:[]},{name:"unlock",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"lockId"},{type:"address",name:"to"}],outputs:[]},{name:"syncAssets",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[]},{name:"catchUp",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"max"}],outputs:[{type:"bool",name:"done"}]},{name:"settle",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[]},{name:"roll",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[{type:"uint256",name:"tip"}]},{name:"sweepDrops",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256[]",name:"dropIds"},{type:"uint256",name:"claimGas"}],outputs:[{type:"uint256[]",name:"amounts"}]},{name:"claim",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"day"},{type:"uint256",name:"asset"},{type:"address",name:"to"}],outputs:[{type:"uint256",name:"amount"}]},{name:"claimMany",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256[]",name:"days_"},{type:"uint256",name:"asset"},{type:"address",name:"to"}],outputs:[{type:"uint256",name:"amount"}]},{name:"claimLock",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"lockId"},{type:"uint256",name:"asset"},{type:"address",name:"to"}],outputs:[{type:"uint256",name:"amount"}]},{name:"balanceOf",type:"function",stateMutability:"view",inputs:[{type:"address",name:"owner"},{type:"uint256",name:"id"}],outputs:[{type:"uint256"}]},{name:"allowance",type:"function",stateMutability:"view",inputs:[{type:"address",name:"owner"},{type:"address",name:"spender"},{type:"uint256",name:"id"}],outputs:[{type:"uint256"}]},{name:"transfer",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"receiver"},{type:"uint256",name:"id"},{type:"uint256",name:"amount"}],outputs:[{type:"bool"}]}]},dayWrapper:{factory:"wrapperFactory",abi:[{name:"shares",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"day",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"assetCount",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"basket",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"asset"}],outputs:[{type:"uint256"}]},{name:"previewRedeem",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"amount"}],outputs:[{type:"uint256[]",name:"cash"}]},{name:"deposit",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"amount"},{type:"address",name:"to"}],outputs:[]},{name:"redeem",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"amount"},{type:"address",name:"to"}],outputs:[{type:"uint256[]",name:"cash"}]},{name:"redeemShort",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"amount"},{type:"address",name:"to"}],outputs:[{type:"uint256[]",name:"cash"}]},{name:"owedTo",type:"function",stateMutability:"view",inputs:[{type:"address",name:"owner"},{type:"uint256",name:"asset"}],outputs:[{type:"uint256"}]},{name:"claimOwed",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"asset"},{type:"address",name:"to"}],outputs:[]},{name:"collect",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[]},{name:"balanceOf",type:"function",stateMutability:"view",inputs:[{type:"address",name:"owner"}],outputs:[{type:"uint256"}]},{name:"totalSupply",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"transfer",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"to"},{type:"uint256",name:"amount"}],outputs:[{type:"bool"}]}]},compounder:{factory:"compoundFactory",abi:[{name:"MIN_SHARES",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"MAX_BANDS",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"MAX_BAND_TICKS",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"int24"}]},{name:"MAX_TIP_BPS",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint16"}]},{name:"CLAIM_GAS",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"ADD_GAS_FLOOR",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"ANCHOR_DRIFT",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"ANCHOR_PERIOD",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"ANCHOR_TOLERANCE",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"int24"}]},{name:"DROP_SCAN",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"DROP_CLAIM_GAS",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"parked",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"dropId"}],outputs:[{type:"bool"}]},{name:"syncSides",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[{type:"uint256",name:"count"}]},{name:"token",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"poolManager",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"poolId",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"poolKey",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"tuple",components:[{type:"address",name:"currency0"},{type:"address",name:"currency1"},{type:"uint24",name:"fee"},{type:"int24",name:"tickSpacing"},{type:"address",name:"hooks"}]}]},{name:"quote",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"tokenIsCurrency0",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bool"}]},{name:"bandTicks",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"int24"}]},{name:"tipBps",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint16"}]},{name:"tipCap",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint128"}]},{name:"reserve",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"bands",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"tuple[]",components:[{type:"int24",name:"tickLower"},{type:"int24",name:"tickUpper"},{type:"uint128",name:"liquidity"}]}]},{name:"anchor",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"tuple",components:[{type:"int24",name:"high"},{type:"int24",name:"low"},{type:"uint40",name:"lookedAt"}]}]},{name:"creator",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"nextDrop",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"holdings",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256",name:"tokens"},{type:"uint256",name:"quote"}]},{name:"deposit",type:"function",stateMutability:"payable",inputs:[{type:"uint256",name:"tokensMax"},{type:"uint256",name:"quoteMax"},{type:"address",name:"to"},{type:"uint256",name:"minShares"},{type:"uint256",name:"deadline"}],outputs:[{type:"uint256",name:"shares"},{type:"uint256",name:"tokens"},{type:"uint256",name:"quote"}]},{name:"redeem",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"shares"},{type:"address",name:"to"},{type:"uint256",name:"minTokens"},{type:"uint256",name:"minQuote"},{type:"uint256",name:"deadline"}],outputs:[{type:"uint256",name:"tokens"},{type:"uint256",name:"quote"}]},{name:"redeemUnlocked",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"shares"},{type:"address",name:"to"},{type:"uint256",name:"minTokens"},{type:"uint256",name:"minQuote"},{type:"uint256",name:"deadline"}],outputs:[{type:"uint256",name:"tokens"},{type:"uint256",name:"quote"}]},{name:"poke",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[{type:"uint256",name:"tip"}]},{name:"claimDrops",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256[]",name:"dropIds"}],outputs:[{type:"uint256",name:"tip"}]},{name:"listSide",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"asset"}],outputs:[{type:"uint256",name:"side"}]},{name:"SCALE",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"MAX_SIDES",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"SIDE_READ_GAS",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"DEAD",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"sideCount",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"fixedSideCount",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"sideAt",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"side"}],outputs:[{type:"tuple",components:[{type:"address",name:"currency"},{type:"uint256",name:"index"},{type:"uint256",name:"carry"},{type:"uint128",name:"recognized"},{type:"uint128",name:"paid"},{type:"uint128",name:"dropped"},{type:"uint40",name:"droppedAt"}]}]},{name:"sideOf",type:"function",stateMutability:"view",inputs:[{type:"address",name:"currency"}],outputs:[{type:"bool",name:"listed"},{type:"uint256",name:"side"}]},{name:"dropStream",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"earningSupply",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"sideClaimable",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"uint256",name:"side"}],outputs:[{type:"uint256"}]},{name:"claimSide",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"side"},{type:"address",name:"to"}],outputs:[{type:"uint256",name:"amount"}]},{name:"balanceOf",type:"function",stateMutability:"view",inputs:[{type:"address",name:"owner"}],outputs:[{type:"uint256"}]},{name:"totalSupply",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"transfer",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"to"},{type:"uint256",name:"amount"}],outputs:[{type:"bool"}]}]}};var $=q(["function approve(address spender,uint256 id,uint256 amount) returns (bool)"]),x=t=>I(t,"Provide the documented Hookr add-on parameters."),W=t=>["view","pure"].includes(t.stateMutability);function R(t){return Object.entries(k).flatMap(([e,i])=>i.abi.filter(n=>W(n)===t).map(n=>({role:e,fn:n})))}function N(t){return{type:"object",oneOf:R(t).map(({role:e,fn:i})=>({type:"object",properties:{addon:{const:e},token:_,...e==="dayWrapper"?{day:C()}:{},function:{const:i.name},params:D(i.inputs)},required:["addon","token",...e==="dayWrapper"?["day"]:[],"function","params"],additionalProperties:!1}))}}function E(t,e){let i=R(e).find(a=>a.role===t.addon&&a.fn.name===t.function);if(!i)throw new r("Choose a documented Hookr add-on function.");let n=["addon","token","function","params",...i.role==="dayWrapper"?["day"]:[]];if(Object.keys(t).length!==n.length||Object.keys(t).some(a=>!n.includes(a)))throw new r("Provide exactly the documented Hookr add-on arguments.");let s;try{s=c(String(t.token))}catch{throw new r("Provide a valid revenue token address.")}let p=0n;if(i.role==="dayWrapper"){if(typeof t.day!="string"||!/^(0|[1-9][0-9]*)$/.test(t.day)||t.day.length>78||BigInt(t.day)>=1n<<256n)throw new r("Provide a wrapper day as a decimal integer string.");p=BigInt(t.day)}return{...i,token:s,day:p,...H(i.fn,x(t.params))}}async function P(t,e,i,n){let s=t.clientFor(d),p=async(f,b,v=[])=>s.readContract({address:c(S[f].address),abi:S[f].abi,functionName:b,args:v}),a=x(await p("tokenizer","tokenizations",[i]));if(typeof a.createdAt!="bigint"||a.createdAt<=0n||c(String(a.creator))===M)throw new r("Current Hookr tokenizer has no matching token record; legacy add-ons need their generation-specific route.");let m=e==="compounder"?void 0:c(String(await p("timeFactory","sharesOf",[i]))),u=e==="timeShares"?m:e==="compounder"?c(String(await p("compoundFactory","vaultOf",[i]))):c(String(await p("wrapperFactory","wrapperOf",[m,n])));if(u===M||m===M)throw new r("Hookr add-on is not open yet. Open it with its pinned factory through hookr_action first.");let y=k[e].abi,l=await s.readContract({address:u,abi:y,functionName:e==="dayWrapper"?"shares":"token"});if(c(String(l))!==(e==="dayWrapper"?m:i))throw new r("Hookr add-on disagrees with its factory record.");if(e==="dayWrapper"&&await s.readContract({address:u,abi:y,functionName:"day"})!==n)throw new r("Hookr day wrapper disagrees with its factory day.");return{target:u,shares:m}}async function X(t,e,i){if(t.network==="testnet")throw new r("Hookr add-ons require mainnet, chain 4663.");let{role:n,token:s,day:p,fn:a,values:m,params:u}=E(e,!1),{target:y,shares:l}=await P(t,n,s,p),f=[],b=[],v=0n,h=t.clientFor(d),A=async(o,w)=>{if(w<0n||w>=1n<<128n)throw new r("Hookr add-on funding exceeds its bounded exact approval.");if(!w)return;if(o===M){v+=w,b.push({token:O,amount:w,to:y});return}let g=await h.readContract({address:o,abi:L,functionName:"allowance",args:[i,y]});g>0n&&g!==w&&f.push(t.approval(o,y,"0",d)),f.push(t.approval(o,y,w.toString(),d)),b.push({token:o,amount:w})};if(n==="timeShares"&&a.name==="lock"&&await A(s,u.amount),n==="dayWrapper"&&a.name==="deposit"){let o=u.amount;if(o<=0n||o>=1n<<128n)throw new r("Hookr wrapper deposit needs a positive bounded share amount.");f.push(t.unsignedTx({chainId:d,to:l,value:"0",data:T({abi:$,functionName:"approve",args:[y,p,o]}),description:`Approve exactly ${o} time shares of day ${p} to the factory-recorded wrapper ${y}.`})),b.push({token:l,id:p,amount:o,to:y})}if(n==="compounder"&&a.name==="deposit"){let o=c(String(await h.readContract({address:y,abi:k.compounder.abi,functionName:"quote"})));await A(s,u.tokensMax),await A(o,u.quoteMax)}if(["redeem","redeemShort","redeemUnlocked"].includes(a.name)&&b.push({token:y,amount:u.shares??u.amount,to:M}),a.name==="transfer"&&b.push({token:y,amount:u.amount,to:c(String(u.receiver??u.to)),...n==="timeShares"?{id:u.id}:{}}),u.deadline!==void 0){let o=await h.getBlock();if(typeof o.timestamp!="bigint"||u.deadline<o.timestamp)throw new r("Hookr add-on deadline expired or chain time is unavailable.")}return f.push(t.unsignedTx({chainId:d,to:y,value:v.toString(),data:T({abi:[a],functionName:a.name,args:m}),description:`Hookr ${n}.${a.name}: ${JSON.stringify(e.params)}. Token ${s}${n==="dayWrapper"?`; day ${p}`:""}. Review lock duration, recipients and minimum outputs.`})),{txs:f,inputs:b}}function Z(t){return[{name:"hookr_addon_read",inputSchema:{...N(!0),description:"Read factory-verified current Hookr revenue time shares, day wrappers or compounders: locks, day income, unwrap baskets, bands and side assets. Open factories via hookr_action."},execute:async e=>{let{role:i,token:n,day:s,fn:p,values:a}=E(e,!0),{target:m}=await P(t,i,n,s),u=await t.clientFor(d).readContract({address:m,abi:[p],functionName:p.name,args:a});return{chainId:d,token:n,contract:m,function:p.name,result:JSON.parse(JSON.stringify(u,(y,l)=>typeof l=="bigint"?l.toString():l))}}},{name:"hookr_addon_action",inputSchema:{...N(!1),description:"Preview current Hookr time-share lock/issue/unlock/roll/claims, day wrap/unwrap/owed claims, or compound deposit/redeem/poke/side claims. Exact approvals, factory provenance and local human confirmation required."},execute:async(e,i)=>{let{txs:n}=await X(t,e,i),s=await t.preview(n,i);return{txs:n,preview:s,summary:`Hookr ${e.addon}.${e.function}; verify the receipt and read the resulting lock or balances.`}}}]}export{X as a,Z as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as H,o as q}from"./CAU44UWP.js";import{a as de,b as ce,c as le}from"./HFQS5344.js";import{a as ae}from"./G7UKNO2I.js";import{a as ue,b as me}from"./BYXBS45D.js";import{a as pe}from"./GZ5TW3WB.js";import{e as U,h as B,m as re}from"./5EHQM6DM.js";import{b as ie}from"./AXYOJBX6.js";import{a as E}from"./EG6M6SSO.js";import{c as se}from"./MYBDO5SA.js";import{c as M,e as x,g as w,k as ee,l as ne,m as te,n as oe}from"./73N3TOJL.js";import{a as h,i as Y}from"./XPFVT2EA.js";import{a as s}from"./5YS5V2LK.js";import{decodeFunctionResult as Ce,encodeAbiParameters as F,encodeFunctionData as N,erc20Abi as V,isAddress as Ie,parseAbi as we,parseAbiParameters as j,toHex as J,zeroAddress as W}from"viem";var k=Y[h].clanker,fe=we(["function deployToken(((address tokenAdmin,string name,string symbol,bytes32 salt,string image,string metadata,string context,uint256 originatingChainId) tokenConfig,(address hook,address pairedToken,int24 tickIfToken0IsClanker,int24 tickSpacing,bytes poolData) poolConfig,(address locker,address[] rewardAdmins,address[] rewardRecipients,uint16[] rewardBps,int24[] tickLower,int24[] tickUpper,uint16[] positionBps,bytes lockerData) lockerConfig,(address mevModule,bytes mevModuleData) mevModuleConfig,(address extension,uint256 msgValue,uint16 extensionBps,bytes extensionData)[] extensionConfigs) config) payable returns (address)","function tokenDeploymentInfo(address) view returns ((address,address,address,address[]))"]),C=we(["function availableFees(address,address) view returns (uint256)","function claim(address,address)","function collectRewards(address)","function mevModuleEnabled(bytes32) view returns (bool)","function mevModuleOperational(bytes32) returns (bool)"]),I={address:k.paired_weth.address,symbol:"WETH",decimals:18,chainId:h},Pe="https://www.clanker.world/api/tokens",ye={type:"string",pattern:"^\\d+$"},he={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"};function P(n){return ne(ee(n,U),U)}function ge(n,t){if(typeof n!="string"||!/^0x[0-9a-fA-F]{64}$/.test(n))throw new s(`Provide an explicit bytes32 ${t}.`);return n}function T(n,t,a=!1){if(n===void 0&&!a)return"";if(typeof n!="string"||a&&!n.trim())throw new s(`Provide ${t} as text.`);return n}function z(n,t=256){return oe(n,`Amount exceeds the uint${t} range.`,{bits:t})}function G(n){return te(n,"The contract returned an invalid amount.").toString()}function O(n,t){let a=Object.keys(n).find(p=>!t.includes(p));if(a)throw new s(`Unsupported Clanker input: ${a}.`)}function be(n,t){return t.changes.map(({token:a,amount:p})=>{let b=p.startsWith("-");return`${b?"-":"+"}${n.formatAmount(b?p.slice(1):p,a.decimals)} ${a.symbol} (${a.address}, chain ${a.chainId})`}).join("; ")}function Te(n){return x(n)&&Array.isArray(n.data)&&Number.isSafeInteger(n.total)&&Number(n.total)>=0&&Number.isSafeInteger(n.tokensDeployed)&&Number(n.tokensDeployed)>=0&&(n.cursor===null||typeof n.cursor=="string"||n.cursor===void 0&&n.data.length===0&&n.total===0&&n.tokensDeployed===0)&&n.data.every(t=>x(t)&&typeof t.name=="string"&&typeof t.symbol=="string"&&Number.isSafeInteger(t.chain_id)&&["contract_address","admin","msg_sender","factory_address"].every(a=>typeof t[a]=="string"&&Ie(t[a],{strict:!1})))}async function ve(n,t={}){O(t,["q","limit","cursor","deployer"]);let a=t.limit??10;if(typeof a!="number"||!Number.isInteger(a)||a<1||a>20)throw new s("Choose an indexer limit from 1 to 20.");let p=new URL(Pe);p.searchParams.set("chainId",String(h)),p.searchParams.set("limit",String(a)),t.q!==void 0&&p.searchParams.set("q",T(t.q,"search")),t.cursor!==void 0&&p.searchParams.set("cursor",T(t.cursor,"cursor",!0)),t.deployer!==void 0&&p.searchParams.set("msgSender",P(t.deployer));let b=await se(n.http,p.toString(),{headers:{"User-Agent":"Oak-Clanker/1.0"}},Te);return{tokens:b.data.filter(v=>v.chain_id===h&&w(v.factory_address,k.factory.address)),total:b.total,cursor:b.cursor||null,tokensDeployed:b.tokensDeployed}}var Se=n=>{let t=()=>n.clientFor(h),a=async e=>{try{return await e()}catch(i){throw new s(n.plainError(i))}},p=(e,i,l,d="0")=>n.unsignedTx({to:e,data:i,value:d,chainId:h,description:l}),b=async(e,i)=>G(await t().readContract({address:k.fee_locker.address,abi:C,functionName:"availableFees",args:[e,i]})),v=async e=>{if(w(e,I.address))return I;let[i,l]=await Promise.all([t().readContract({address:e,abi:V,functionName:"symbol"}),t().readContract({address:e,abi:V,functionName:"decimals"})]);if(typeof i!="string"||!i.trim()||!Number.isInteger(l)||l<0||l>255)throw new s("The contract returned invalid token metadata.");return{address:e,chainId:h,symbol:i,decimals:l}},Z=e=>ve(n,e),ke=async(e,i)=>{if(O(e,["name","symbol","salt","image","metadata","context","vanity","initialBuy","minAmountOut","slippageBps","rewards","vault","airdrop","feeBps","pool"]),e.vanity!==void 0&&e.vanity!==!1)throw new s("Clanker launches use vanity false and an explicit salt.");let l=T(e.name,"token name",!0),d=T(e.symbol,"token symbol",!0),g=ge(e.salt,"salt"),f=z(e.initialBuy??"0"),u=e.slippageBps??H;if(typeof u!="number")throw new s("Slippage must be an integer from 0 to 9999 bps.");q("0",u);let o=e.minAmountOut===void 0?void 0:z(e.minAmountOut,128);if(o!==void 0&&o<=1n)throw new s("Initial-buy minimum must exceed one base unit.");if(!f&&o!==void 0)throw new s("A minimum requires a positive initial buy.");let c=ce(e,i);B(e.feeBps??100,0,1e3);let y=me(e);if(f&&!w(y.poolConfig.pairedToken,I.address))throw new s("An initial ETH buy currently requires a WETH-paired pool. Launch without an initial buy and obtain a protected swap quote separately.");let r=e.rewards??[{admin:i,recipient:i,bps:1e4,feePreference:0}];if(!Array.isArray(r)||!r.length||r.length>7)throw new s("Provide one to seven reward allocations.");let A=r.map(m=>{if(!x(m))throw new s("Provide reward allocations as objects.");return O(m,["admin","recipient","bps","feePreference"]),{admin:P(m.admin),recipient:P(m.recipient),bps:B(m.bps,1,1e4),feePreference:B(m.feePreference??0,0,2)}});if(A.reduce((m,S)=>m+S.bps,0)!==1e4)throw new s("Reward allocations must total 10000 bps.");let $={tokenConfig:{tokenAdmin:i,name:l,symbol:d,salt:g,image:T(e.image,"image"),metadata:T(e.metadata,"metadata"),context:e.context===void 0?JSON.stringify({interface:"Oak",platform:"robinhood"}):T(e.context,"context"),originatingChainId:BigInt(h)},poolConfig:y.poolConfig,lockerConfig:{locker:k.locker.address,rewardAdmins:A.map(m=>m.admin),rewardRecipients:A.map(m=>m.recipient),rewardBps:A.map(m=>m.bps),tickLower:y.tickLower,tickUpper:y.tickUpper,positionBps:y.positionBps,lockerData:F(j("(uint8[])"),[[A.map(m=>m.feePreference)]])},mevModuleConfig:{mevModule:k.mev_module.address,mevModuleData:F(j("(uint24,uint24,uint256)"),[[666777,41673,15n]])},extensionConfigs:c},xe=await t().simulateContract({address:k.factory.address,abi:fe,functionName:"deployToken",args:[$],account:i,value:0n,gas:E}),_=P(xe.result),K=m=>{let S=[...c,...f?[{extension:k.devbuy.address,msgValue:f,extensionBps:0,extensionData:F(j("(address,address,uint24,int24,address),uint128,address"),[[W,W,0,0,W],m,i])}]:[]];return p(k.factory.address,N({abi:fe,functionName:"deployToken",args:[{...$,extensionConfigs:S}]}),`Launch ${l} (${d}); initial buy ${f} native ETH base units.`,f.toString())};if(f&&o===void 0){let S=(await n.preview([K(0n)],i)).changes.filter(D=>D.token.chainId===h&&w(D.token.address,_)&&D.token.decimals===18).reduce((D,X)=>D+(/^-?\d+$/.test(X.amount)?BigInt(X.amount):(()=>{throw new s("Invalid initial-buy simulation amount.")})()),0n);if(S<=0n)throw new s("Initial-buy simulation returned no token output.");if(o=z(q(S.toString(),u),128),o<=1n)throw new s("Initial-buy output is too small for a protected minimum.")}let Q=[K(o??0n)],R=await n.preview(Q,i);return{txs:Q,preview:R,predictedToken:_,token:{address:_,chainId:h,symbol:d,decimals:18},...o!==void 0?{minAmountOut:o.toString()}:{},summary:`Launch ${d} at ${_} (CREATE2 address predicted from simulation); vanity false; salt ${g}. Supply 100000000000000000000000000000 base units (18 decimals). ${y.feeSummary}; protocol adds 20% of LP fees. Pool and LP allocations: ${JSON.stringify(y)}. Reward allocations: ${JSON.stringify(A)}. Extensions: ${JSON.stringify({vault:e.vault,airdrop:e.airdrop})}. Sniper fees 666777 to 41673 over 15 seconds. ${R.summary} ${be(n,R)}`}},Ae=async(e,i)=>{if(O(e,["token","poolId","collect"]),e.collect!==void 0&&typeof e.collect!="boolean")throw new s("collect must be boolean.");if(e.collect===!1&&e.poolId!==void 0)throw new s("poolId requires collection.");if(e.collect===!0&&e.token===void 0)throw new s("Collection requires a Clanker token.");if(e.poolId!==void 0&&e.token===void 0)throw new s("A pool ID requires its Clanker token.");let l=[I],d=[];if(e.token!==void 0){let o=P(e.token);if(w(o,I.address))throw new s("Provide the launched Clanker token, not WETH.");if(e.collect!==!1){let c=await re(n,o),{poolId:y,hook:r,locker:A}=c;if(e.poolId!==void 0&&!w(ge(e.poolId,"pool ID for fee collection"),y))throw new s("The supplied pool ID does not match the onchain Clanker pool.");w(c.pairedToken,I.address)||l.splice(0,1,await v(c.pairedToken));let $=await t().readContract({address:r,abi:C,functionName:"mevModuleEnabled",args:[y]});if(typeof $!="boolean")throw new s("The hook returned an invalid MEV guard state.");$&&d.push(p(r,N({abi:C,functionName:"mevModuleOperational",args:[y]}),"Update the Clanker pool MEV guard before collection.")),d.push(p(A,N({abi:C,functionName:"collectRewards",args:[o]}),"Collect pending LP fees into the fee locker."))}l.push(await v(o))}let g;if(d.length){if(await t().getChainId()!==h)throw new s("Fee simulation endpoint is on the wrong chain.");let o=[...d.map(r=>({from:i,gas:J(E),to:r.to,data:r.data,value:J(BigInt(r.value))})),...l.map(r=>({from:i,gas:J(E),to:k.fee_locker.address,data:N({abi:C,functionName:"availableFees",args:[i,r.address]}),value:"0x0"}))],c=await t().request({method:"eth_simulateV1",params:[{blockStateCalls:[{calls:o}],validation:!1,traceTransfers:!1},"latest"]},{retryCount:0});if(!Array.isArray(c)||c.length!==1||!x(c[0])||!Array.isArray(c[0].calls)||c[0].calls.length!==o.length)throw new s("The endpoint returned an unexpected fee simulation response.");let y=c[0].calls;if(!y.every(r=>x(r)&&r.status==="0x1"&&!r.error))throw new s("Clanker fee collection simulation failed.");g=y.slice(d.length).map(r=>{if(!x(r)||typeof r.returnData!="string"||!/^0x[0-9a-fA-F]{64}$/.test(r.returnData))throw new s("The endpoint returned an invalid fee balance.");return G(Ce({abi:C,functionName:"availableFees",data:r.returnData}))})}else g=await Promise.all(l.map(o=>b(i,o.address)));let f=l.flatMap((o,c)=>BigInt(g[c])>0n?[{token:o,amount:g[c]}]:[]);if(!f.length)throw new s("No claimable fees for this wallet; pending LP fees may require the MEV window to end.");for(let{token:o}of f)d.push(p(k.fee_locker.address,N({abi:C,functionName:"claim",args:[i,o.address]}),`Claim ${o.symbol} fees to ${i}.`));let u=await n.preview(d,i);return{txs:d,preview:u,fees:f,summary:`Claim fees to ${i}. WETH fees aggregate across all Clanker launches for this recipient. ${u.summary} ${be(n,u)}`}},L=(e,i,l,d)=>({name:`clanker_${e}`,inputSchema:{type:"object",properties:i,required:l,additionalProperties:!1},execute:(g,f)=>a(async()=>d(g,P(f)))});return{tools:[L("launch",{name:{type:"string"},symbol:{type:"string"},salt:he,image:{type:"string"},metadata:{type:"string"},context:{type:"string"},vanity:{const:!1},initialBuy:{...ye,description:"Native ETH base units, 18 decimals."},minAmountOut:{...ye,description:"Minimum new token base units, 18 decimals; derived from simulation when omitted."},slippageBps:{type:"integer",minimum:0,maximum:9999,default:H},feeBps:{type:"integer",minimum:0,maximum:1e3,default:100},pool:ue,rewards:{type:"array",minItems:1,maxItems:7,items:{type:"object",properties:{admin:M,recipient:M,bps:{type:"integer",minimum:1,maximum:1e4},feePreference:{type:"integer",minimum:0,maximum:2}},required:["admin","recipient","bps"],additionalProperties:!1}},...de},["name","symbol","salt"],ke),L("claim",{token:{...M,description:"Launched token; derives its onchain pool and collects pending LP fees before claiming."},poolId:{...he,description:"Optional assertion against the derived pool ID."},collect:{type:"boolean",default:!0,description:"Set false to claim only already-collected fees."}},[],Ae),L("browse",{q:{type:"string"},limit:{type:"integer",minimum:1,maximum:20},cursor:{type:"string"},deployer:M},[],Z)],positions:e=>a(async()=>{P(e);let i=new Map,l=new Set,d;do{let u=await Z({deployer:e,limit:20,...d?{cursor:d}:{}});for(let o of u.tokens)w(o.msg_sender,e)&&i.set(o.contract_address.toLowerCase(),o);if(u.cursor&&l.has(u.cursor))throw new s("The Clanker indexer repeated a pagination cursor.");u.cursor&&l.add(u.cursor),d=u.cursor??void 0}while(d);let g=[],f=[I];for(let[u,o]of i){let c=await v(o.contract_address),y=G(await t().readContract({address:c.address,abi:V,functionName:"balanceOf",args:[e]}));g.push({module:"clanker",id:`launch:${u}`,chainId:h,assets:[{token:c,amount:y}],description:`Indexed launch ${o.name}; wallet token balance, not locked LP principal.`}),f.some(r=>w(r.address,c.address))||f.push(c)}for(let u of f){let o=await b(e,u.address);BigInt(o)>0n&&g.push({module:"clanker",id:`fees:${u.address.toLowerCase()}`,chainId:h,assets:[{token:u,amount:o}],description:"Collected fees across launches for this recipient. Pending LP fees excluded; token-side discovery covers indexed launches by this wallet."})}return g})}},Fe=n=>ie("clanker",[Se(n),ae(n),le(n),pe(n)]);export{ve as a,Se as b,Fe as c};
|
|
1
|
+
import{b as H,o as q}from"./5O5ZE3ZV.js";import{a as de,b as ce,c as le}from"./CQCVFRQ5.js";import{a as ae}from"./KHJFXJBU.js";import{a as ue,b as me}from"./WVXW6VL3.js";import{a as pe}from"./GIV5JMTE.js";import{e as U,h as B,m as re}from"./WQ6H62DM.js";import{b as ie}from"./AXYOJBX6.js";import{a as E}from"./EG6M6SSO.js";import{c as se}from"./MYBDO5SA.js";import{c as M,e as x,g as w,k as ee,l as ne,m as te,n as oe}from"./73N3TOJL.js";import{a as h,i as Y}from"./G6HCV67X.js";import{a as s}from"./5YS5V2LK.js";import{decodeFunctionResult as Ce,encodeAbiParameters as F,encodeFunctionData as N,erc20Abi as V,isAddress as Ie,parseAbi as we,parseAbiParameters as j,toHex as J,zeroAddress as W}from"viem";var k=Y[h].clanker,fe=we(["function deployToken(((address tokenAdmin,string name,string symbol,bytes32 salt,string image,string metadata,string context,uint256 originatingChainId) tokenConfig,(address hook,address pairedToken,int24 tickIfToken0IsClanker,int24 tickSpacing,bytes poolData) poolConfig,(address locker,address[] rewardAdmins,address[] rewardRecipients,uint16[] rewardBps,int24[] tickLower,int24[] tickUpper,uint16[] positionBps,bytes lockerData) lockerConfig,(address mevModule,bytes mevModuleData) mevModuleConfig,(address extension,uint256 msgValue,uint16 extensionBps,bytes extensionData)[] extensionConfigs) config) payable returns (address)","function tokenDeploymentInfo(address) view returns ((address,address,address,address[]))"]),C=we(["function availableFees(address,address) view returns (uint256)","function claim(address,address)","function collectRewards(address)","function mevModuleEnabled(bytes32) view returns (bool)","function mevModuleOperational(bytes32) returns (bool)"]),I={address:k.paired_weth.address,symbol:"WETH",decimals:18,chainId:h},Pe="https://www.clanker.world/api/tokens",ye={type:"string",pattern:"^\\d+$"},he={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"};function P(n){return ne(ee(n,U),U)}function ge(n,t){if(typeof n!="string"||!/^0x[0-9a-fA-F]{64}$/.test(n))throw new s(`Provide an explicit bytes32 ${t}.`);return n}function T(n,t,a=!1){if(n===void 0&&!a)return"";if(typeof n!="string"||a&&!n.trim())throw new s(`Provide ${t} as text.`);return n}function z(n,t=256){return oe(n,`Amount exceeds the uint${t} range.`,{bits:t})}function G(n){return te(n,"The contract returned an invalid amount.").toString()}function O(n,t){let a=Object.keys(n).find(p=>!t.includes(p));if(a)throw new s(`Unsupported Clanker input: ${a}.`)}function be(n,t){return t.changes.map(({token:a,amount:p})=>{let b=p.startsWith("-");return`${b?"-":"+"}${n.formatAmount(b?p.slice(1):p,a.decimals)} ${a.symbol} (${a.address}, chain ${a.chainId})`}).join("; ")}function Te(n){return x(n)&&Array.isArray(n.data)&&Number.isSafeInteger(n.total)&&Number(n.total)>=0&&Number.isSafeInteger(n.tokensDeployed)&&Number(n.tokensDeployed)>=0&&(n.cursor===null||typeof n.cursor=="string"||n.cursor===void 0&&n.data.length===0&&n.total===0&&n.tokensDeployed===0)&&n.data.every(t=>x(t)&&typeof t.name=="string"&&typeof t.symbol=="string"&&Number.isSafeInteger(t.chain_id)&&["contract_address","admin","msg_sender","factory_address"].every(a=>typeof t[a]=="string"&&Ie(t[a],{strict:!1})))}async function ve(n,t={}){O(t,["q","limit","cursor","deployer"]);let a=t.limit??10;if(typeof a!="number"||!Number.isInteger(a)||a<1||a>20)throw new s("Choose an indexer limit from 1 to 20.");let p=new URL(Pe);p.searchParams.set("chainId",String(h)),p.searchParams.set("limit",String(a)),t.q!==void 0&&p.searchParams.set("q",T(t.q,"search")),t.cursor!==void 0&&p.searchParams.set("cursor",T(t.cursor,"cursor",!0)),t.deployer!==void 0&&p.searchParams.set("msgSender",P(t.deployer));let b=await se(n.http,p.toString(),{headers:{"User-Agent":"Oak-Clanker/1.0"}},Te);return{tokens:b.data.filter(v=>v.chain_id===h&&w(v.factory_address,k.factory.address)),total:b.total,cursor:b.cursor||null,tokensDeployed:b.tokensDeployed}}var Se=n=>{let t=()=>n.clientFor(h),a=async e=>{try{return await e()}catch(i){throw new s(n.plainError(i))}},p=(e,i,l,d="0")=>n.unsignedTx({to:e,data:i,value:d,chainId:h,description:l}),b=async(e,i)=>G(await t().readContract({address:k.fee_locker.address,abi:C,functionName:"availableFees",args:[e,i]})),v=async e=>{if(w(e,I.address))return I;let[i,l]=await Promise.all([t().readContract({address:e,abi:V,functionName:"symbol"}),t().readContract({address:e,abi:V,functionName:"decimals"})]);if(typeof i!="string"||!i.trim()||!Number.isInteger(l)||l<0||l>255)throw new s("The contract returned invalid token metadata.");return{address:e,chainId:h,symbol:i,decimals:l}},Z=e=>ve(n,e),ke=async(e,i)=>{if(O(e,["name","symbol","salt","image","metadata","context","vanity","initialBuy","minAmountOut","slippageBps","rewards","vault","airdrop","feeBps","pool"]),e.vanity!==void 0&&e.vanity!==!1)throw new s("Clanker launches use vanity false and an explicit salt.");let l=T(e.name,"token name",!0),d=T(e.symbol,"token symbol",!0),g=ge(e.salt,"salt"),f=z(e.initialBuy??"0"),u=e.slippageBps??H;if(typeof u!="number")throw new s("Slippage must be an integer from 0 to 9999 bps.");q("0",u);let o=e.minAmountOut===void 0?void 0:z(e.minAmountOut,128);if(o!==void 0&&o<=1n)throw new s("Initial-buy minimum must exceed one base unit.");if(!f&&o!==void 0)throw new s("A minimum requires a positive initial buy.");let c=ce(e,i);B(e.feeBps??100,0,1e3);let y=me(e);if(f&&!w(y.poolConfig.pairedToken,I.address))throw new s("An initial ETH buy currently requires a WETH-paired pool. Launch without an initial buy and obtain a protected swap quote separately.");let r=e.rewards??[{admin:i,recipient:i,bps:1e4,feePreference:0}];if(!Array.isArray(r)||!r.length||r.length>7)throw new s("Provide one to seven reward allocations.");let A=r.map(m=>{if(!x(m))throw new s("Provide reward allocations as objects.");return O(m,["admin","recipient","bps","feePreference"]),{admin:P(m.admin),recipient:P(m.recipient),bps:B(m.bps,1,1e4),feePreference:B(m.feePreference??0,0,2)}});if(A.reduce((m,S)=>m+S.bps,0)!==1e4)throw new s("Reward allocations must total 10000 bps.");let $={tokenConfig:{tokenAdmin:i,name:l,symbol:d,salt:g,image:T(e.image,"image"),metadata:T(e.metadata,"metadata"),context:e.context===void 0?JSON.stringify({interface:"Oak",platform:"robinhood"}):T(e.context,"context"),originatingChainId:BigInt(h)},poolConfig:y.poolConfig,lockerConfig:{locker:k.locker.address,rewardAdmins:A.map(m=>m.admin),rewardRecipients:A.map(m=>m.recipient),rewardBps:A.map(m=>m.bps),tickLower:y.tickLower,tickUpper:y.tickUpper,positionBps:y.positionBps,lockerData:F(j("(uint8[])"),[[A.map(m=>m.feePreference)]])},mevModuleConfig:{mevModule:k.mev_module.address,mevModuleData:F(j("(uint24,uint24,uint256)"),[[666777,41673,15n]])},extensionConfigs:c},xe=await t().simulateContract({address:k.factory.address,abi:fe,functionName:"deployToken",args:[$],account:i,value:0n,gas:E}),_=P(xe.result),K=m=>{let S=[...c,...f?[{extension:k.devbuy.address,msgValue:f,extensionBps:0,extensionData:F(j("(address,address,uint24,int24,address),uint128,address"),[[W,W,0,0,W],m,i])}]:[]];return p(k.factory.address,N({abi:fe,functionName:"deployToken",args:[{...$,extensionConfigs:S}]}),`Launch ${l} (${d}); initial buy ${f} native ETH base units.`,f.toString())};if(f&&o===void 0){let S=(await n.preview([K(0n)],i)).changes.filter(D=>D.token.chainId===h&&w(D.token.address,_)&&D.token.decimals===18).reduce((D,X)=>D+(/^-?\d+$/.test(X.amount)?BigInt(X.amount):(()=>{throw new s("Invalid initial-buy simulation amount.")})()),0n);if(S<=0n)throw new s("Initial-buy simulation returned no token output.");if(o=z(q(S.toString(),u),128),o<=1n)throw new s("Initial-buy output is too small for a protected minimum.")}let Q=[K(o??0n)],R=await n.preview(Q,i);return{txs:Q,preview:R,predictedToken:_,token:{address:_,chainId:h,symbol:d,decimals:18},...o!==void 0?{minAmountOut:o.toString()}:{},summary:`Launch ${d} at ${_} (CREATE2 address predicted from simulation); vanity false; salt ${g}. Supply 100000000000000000000000000000 base units (18 decimals). ${y.feeSummary}; protocol adds 20% of LP fees. Pool and LP allocations: ${JSON.stringify(y)}. Reward allocations: ${JSON.stringify(A)}. Extensions: ${JSON.stringify({vault:e.vault,airdrop:e.airdrop})}. Sniper fees 666777 to 41673 over 15 seconds. ${R.summary} ${be(n,R)}`}},Ae=async(e,i)=>{if(O(e,["token","poolId","collect"]),e.collect!==void 0&&typeof e.collect!="boolean")throw new s("collect must be boolean.");if(e.collect===!1&&e.poolId!==void 0)throw new s("poolId requires collection.");if(e.collect===!0&&e.token===void 0)throw new s("Collection requires a Clanker token.");if(e.poolId!==void 0&&e.token===void 0)throw new s("A pool ID requires its Clanker token.");let l=[I],d=[];if(e.token!==void 0){let o=P(e.token);if(w(o,I.address))throw new s("Provide the launched Clanker token, not WETH.");if(e.collect!==!1){let c=await re(n,o),{poolId:y,hook:r,locker:A}=c;if(e.poolId!==void 0&&!w(ge(e.poolId,"pool ID for fee collection"),y))throw new s("The supplied pool ID does not match the onchain Clanker pool.");w(c.pairedToken,I.address)||l.splice(0,1,await v(c.pairedToken));let $=await t().readContract({address:r,abi:C,functionName:"mevModuleEnabled",args:[y]});if(typeof $!="boolean")throw new s("The hook returned an invalid MEV guard state.");$&&d.push(p(r,N({abi:C,functionName:"mevModuleOperational",args:[y]}),"Update the Clanker pool MEV guard before collection.")),d.push(p(A,N({abi:C,functionName:"collectRewards",args:[o]}),"Collect pending LP fees into the fee locker."))}l.push(await v(o))}let g;if(d.length){if(await t().getChainId()!==h)throw new s("Fee simulation endpoint is on the wrong chain.");let o=[...d.map(r=>({from:i,gas:J(E),to:r.to,data:r.data,value:J(BigInt(r.value))})),...l.map(r=>({from:i,gas:J(E),to:k.fee_locker.address,data:N({abi:C,functionName:"availableFees",args:[i,r.address]}),value:"0x0"}))],c=await t().request({method:"eth_simulateV1",params:[{blockStateCalls:[{calls:o}],validation:!1,traceTransfers:!1},"latest"]},{retryCount:0});if(!Array.isArray(c)||c.length!==1||!x(c[0])||!Array.isArray(c[0].calls)||c[0].calls.length!==o.length)throw new s("The endpoint returned an unexpected fee simulation response.");let y=c[0].calls;if(!y.every(r=>x(r)&&r.status==="0x1"&&!r.error))throw new s("Clanker fee collection simulation failed.");g=y.slice(d.length).map(r=>{if(!x(r)||typeof r.returnData!="string"||!/^0x[0-9a-fA-F]{64}$/.test(r.returnData))throw new s("The endpoint returned an invalid fee balance.");return G(Ce({abi:C,functionName:"availableFees",data:r.returnData}))})}else g=await Promise.all(l.map(o=>b(i,o.address)));let f=l.flatMap((o,c)=>BigInt(g[c])>0n?[{token:o,amount:g[c]}]:[]);if(!f.length)throw new s("No claimable fees for this wallet; pending LP fees may require the MEV window to end.");for(let{token:o}of f)d.push(p(k.fee_locker.address,N({abi:C,functionName:"claim",args:[i,o.address]}),`Claim ${o.symbol} fees to ${i}.`));let u=await n.preview(d,i);return{txs:d,preview:u,fees:f,summary:`Claim fees to ${i}. WETH fees aggregate across all Clanker launches for this recipient. ${u.summary} ${be(n,u)}`}},L=(e,i,l,d)=>({name:`clanker_${e}`,inputSchema:{type:"object",properties:i,required:l,additionalProperties:!1},execute:(g,f)=>a(async()=>d(g,P(f)))});return{tools:[L("launch",{name:{type:"string"},symbol:{type:"string"},salt:he,image:{type:"string"},metadata:{type:"string"},context:{type:"string"},vanity:{const:!1},initialBuy:{...ye,description:"Native ETH base units, 18 decimals."},minAmountOut:{...ye,description:"Minimum new token base units, 18 decimals; derived from simulation when omitted."},slippageBps:{type:"integer",minimum:0,maximum:9999,default:H},feeBps:{type:"integer",minimum:0,maximum:1e3,default:100},pool:ue,rewards:{type:"array",minItems:1,maxItems:7,items:{type:"object",properties:{admin:M,recipient:M,bps:{type:"integer",minimum:1,maximum:1e4},feePreference:{type:"integer",minimum:0,maximum:2}},required:["admin","recipient","bps"],additionalProperties:!1}},...de},["name","symbol","salt"],ke),L("claim",{token:{...M,description:"Launched token; derives its onchain pool and collects pending LP fees before claiming."},poolId:{...he,description:"Optional assertion against the derived pool ID."},collect:{type:"boolean",default:!0,description:"Set false to claim only already-collected fees."}},[],Ae),L("browse",{q:{type:"string"},limit:{type:"integer",minimum:1,maximum:20},cursor:{type:"string"},deployer:M},[],Z)],positions:e=>a(async()=>{P(e);let i=new Map,l=new Set,d;do{let u=await Z({deployer:e,limit:20,...d?{cursor:d}:{}});for(let o of u.tokens)w(o.msg_sender,e)&&i.set(o.contract_address.toLowerCase(),o);if(u.cursor&&l.has(u.cursor))throw new s("The Clanker indexer repeated a pagination cursor.");u.cursor&&l.add(u.cursor),d=u.cursor??void 0}while(d);let g=[],f=[I];for(let[u,o]of i){let c=await v(o.contract_address),y=G(await t().readContract({address:c.address,abi:V,functionName:"balanceOf",args:[e]}));g.push({module:"clanker",id:`launch:${u}`,chainId:h,assets:[{token:c,amount:y}],description:`Indexed launch ${o.name}; wallet token balance, not locked LP principal.`}),f.some(r=>w(r.address,c.address))||f.push(c)}for(let u of f){let o=await b(e,u.address);BigInt(o)>0n&&g.push({module:"clanker",id:`fees:${u.address.toLowerCase()}`,chainId:h,assets:[{token:u,amount:o}],description:"Collected fees across launches for this recipient. Pending LP fees excluded; token-side discovery covers indexed launches by this wallet."})}return g})}},Fe=n=>ie("clanker",[Se(n),ae(n),le(n),pe(n)]);export{ve as a,Se as b,Fe as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as $}from"./
|
|
1
|
+
import{a as $}from"./Z7RL4NGX.js";import{b as S,d as A,e as j,f as T,g as O,h as I,i as P,m as k,n as M,q as f,s as B}from"./53N7PNJH.js";import{a as w,e as _}from"./73N3TOJL.js";import{a as p}from"./G6HCV67X.js";import{a as d}from"./5YS5V2LK.js";function U(u){return{...u,token:{...u.token,symbol:f(u.token.symbol)??"unknown"}}}var J=u=>{let R=B(u);async function z(n,i){let g=T(i),r=I(n.originChainId),e=I(n.destinationChainId);if(r!==p&&e!==p)throw new d(`A Relay quote must start or end on chain ${p}.`);let h=O(n.originCurrency??S),b=O(n.destinationCurrency??S),c=T(n.recipient??g),a=P(n.amount);if(a==="0")throw new d("Provide a positive bridge amount.");let t=n.tradeType??"EXACT_INPUT";if(!["EXACT_INPUT","EXACT_OUTPUT","EXPECTED_OUTPUT"].includes(String(t)))throw new d("Choose EXACT_INPUT, EXACT_OUTPUT or EXPECTED_OUTPUT.");let m={};for(let E of["includedSwapSources","excludedSwapSources","includedOriginSwapSources","includedDestinationSwapSources"]){let y=n[E];if(y!==void 0){if(!Array.isArray(y)||y.length>100||y.some(x=>typeof x!="string"||!/^[A-Za-z0-9._ -]{1,128}$/.test(x)))throw new d("Provide valid Relay swap source names.");m[E]=y}}let N=await R("/quote/v2",{user:g,recipient:c,originChainId:r,destinationChainId:e,originCurrency:h,destinationCurrency:b,amount:a,tradeType:t,...m}),o=A(N.details),l=U(k(o.currencyIn)),s=U(k(o.currencyOut)),C=P(A(o.currencyOut).minimumAmount);M(T(o.sender)===g&&T(o.recipient)===c&&l.token.chainId===r&&l.token.address===h&&(t==="EXACT_INPUT"?l.amount===a:s.amount===a)&&s.token.chainId===e&&s.token.address===b&&BigInt(C)<=BigInt(s.amount));let F=Object.fromEntries(Object.entries(A(N.fees)).map(([E,y])=>[E,U(k(y))])),v=typeof o.timeEstimate=="number"&&Number.isFinite(o.timeEstimate)&&o.timeEstimate>=0?o.timeEstimate:void 0,X=e===p,q=X?"relay_bridge_in":"relay_bridge_out",D=t==="EXACT_INPUT"&&Object.keys(m).length===0&&r!==e&&(!X||$(r)!==void 0);return{executable:!1,nextAction:D?q:void 0,originChainId:r,destinationChainId:e,recipient:c,tradeType:t,amountIn:l,amountOut:s,minAmountOut:{token:s.token,amount:C},fees:F,slippage:{source:"provider",minimumAmount:C},...v===void 0?{}:{timeEstimateSeconds:v},summary:`Read-only Relay estimate: ${l.amount} base units of ${l.token.symbol} (${l.token.decimals} decimals) on chain ${r} for about ${s.amount}, minimum ${C}, base units of ${s.token.symbol} (${s.token.decimals} decimals) on chain ${e} for ${c}. Slippage: selected by Relay; Oak sent no slippage setting. The returned minimum above is the quote floor. Relay fees are already deducted from the output; origin gas is separate. Nothing was built or signed, and this estimate cannot be executed. ${D?`To bridge, call ${q}; it fetches a fresh quote and shows its own preview for human confirmation.`:"This estimate shape has no matching Oak execution path. No action will preserve these trade type or routing options."}`}}async function Z(n){let i=n.chainId===void 0?void 0:I(n.chainId),r=j((await R("/chains")).chains).map(A).flatMap(e=>{if(typeof e.id!="number"||!Number.isSafeInteger(e.id)||e.id<=0)return[];if(i!==void 0&&e.id!==i)return[];let h=e.disabled===!1,b=_(e.currency)?e.currency:{},c={chainId:e.id,name:f(e.displayName,"name")??f(e.name,"name")??String(e.id),vmType:f(e.vmType),nativeCurrency:{symbol:f(b.symbol),decimals:typeof b.decimals=="number"?b.decimals:void 0},bridgeIn:e.id!==p&&h&&$(e.id)!==void 0,bridgeOut:e.id!==p&&h&&e.vmType==="evm"};if(i===void 0)return[c];let a=new Map;for(let t of[...Array.isArray(e.featuredTokens)?e.featuredTokens:[],...Array.isArray(e.erc20Currencies)?e.erc20Currencies:[]]){if(!_(t)||typeof t.address!="string"||!new RegExp(w).test(t.address)||typeof t.decimals!="number"||!Number.isInteger(t.decimals)||t.decimals<0||t.decimals>255)continue;let m=T(t.address);a.has(m)||a.set(m,{address:m,symbol:f(t.symbol)??"unknown",decimals:t.decimals,bridgeable:t.supportsBridging===!0})}return[{...c,currencies:[...a.values()]}]});if(i!==void 0&&!r.length)throw new d(`Relay does not list chain ${i}.`);return{chains:r,summary:`${r.length} Relay chain${r.length===1?"":"s"}. bridgeIn marks origins relay_bridge_in can build from; bridgeOut marks destinations relay_bridge_out can reach. Currency lists are Relay-reported display data; bridgeable false means Relay does not bridge that token. Confirm token addresses before bridging.`}}return{tools:[{name:"relay_quote",inputSchema:{type:"object",additionalProperties:!1,required:["originChainId","destinationChainId","amount"],properties:{originChainId:{type:"integer",minimum:1},destinationChainId:{type:"integer",minimum:1},originCurrency:{type:"string",pattern:w},destinationCurrency:{type:"string",pattern:w},amount:{type:"string",pattern:"^[1-9][0-9]*$"},recipient:{type:"string",pattern:w},tradeType:{type:"string",enum:["EXACT_INPUT","EXACT_OUTPUT","EXPECTED_OUTPUT"]},...Object.fromEntries(["includedSwapSources","excludedSwapSources","includedOriginSwapSources","includedDestinationSwapSources"].map(n=>[n,{type:"array",maxItems:100,items:{type:"string",pattern:"^[A-Za-z0-9._ -]{1,128}$"}}]))}},execute:async(n,i)=>{try{return await z(n,i)}catch(g){throw new d(u.plainError(g))}}},{name:"relay_chains",inputSchema:{type:"object",additionalProperties:!1,properties:{chainId:{type:"integer",minimum:1}}},execute:async n=>{try{return await Z(n)}catch(i){throw new d(u.plainError(i))}}}]}};export{J as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as b,g as W,h as j,m as z}from"./
|
|
1
|
+
import{d as b,g as W,h as j,m as z}from"./IBXYIN7Q.js";import{a as B,e as F,g as R}from"./3NDVXEBR.js";import{b as C,c as q,s as X,z as D}from"./Q356HHCL.js";import{a as U}from"./UWOFA6GV.js";import{g as T}from"./73N3TOJL.js";import{a as O}from"./G6HCV67X.js";import{a as c}from"./5YS5V2LK.js";import{decodeEventLog as J,parseAbi as V,toEventSelector as Z,toHex as x}from"viem";var K=V(["function getPositionInfo(bytes32 poolId,address owner,int24 tickLower,int24 tickUpper,bytes32 salt) view returns (uint128 liquidity,uint256 feeGrowthInside0LastX128,uint256 feeGrowthInside1LastX128)","function getFeeGrowthInside(bytes32 poolId,int24 tickLower,int24 tickUpper) view returns (uint256,uint256)"]),Q=V(["function ownerOf(uint256) view returns (address)","function getPoolAndPositionInfo(uint256) view returns ((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks),uint256)"]),A=V(["function slot0() view returns (uint160,int24,uint16,uint16,uint16,uint8,bool)","function feeGrowthGlobal0X128() view returns (uint256)","function feeGrowthGlobal1X128() view returns (uint256)","function ticks(int24) view returns (uint128,int128,uint256,uint256,int56,uint160,uint32,bool)"]),$=(1n<<256n)-1n,ee=1n<<128n,P=(s,t)=>s-t&$;function G(s,t,r,n=0n){return P(s,t)*r/ee+n}function ue(s){return{tools:[{name:"uniswap_fees",inputSchema:{type:"object",additionalProperties:!1,required:["version","tokenId"],properties:{includeHistory:{type:"boolean",description:"V3 only: read the complete NFT collect/decrease event history for lifetime fees. This can require multiple RPC log windows."},version:{type:"string",enum:["v3","v4"]},tokenId:U()}},async execute(t){if(R(t,["version","tokenId","includeHistory"]),t.includeHistory!==void 0&&typeof t.includeHistory!="boolean")throw new c("includeHistory must be a boolean.");if(t.includeHistory===!0&&t.version!=="v3")throw new c("V4 position lifetime fees need historical liquidity/fee-growth checkpoints; no verified history source is configured.");let r=B(t.tokenId,"tokenId"),n=s.clientFor(O),i=await n.getBlockNumber();if(t.version!=="v3"&&t.version!=="v4")throw new c("Provide version v3 or v4 for fee reads.");let _=await n.readContract({address:t.version==="v4"?C:b.positionManager,abi:Q,functionName:"ownerOf",args:[r],blockNumber:i}),v,m,a,d,u,w=0n,p=0n;if(t.version==="v4"){let[e,f]=await n.readContract({address:C,abi:Q,functionName:"getPoolAndPositionInfo",args:[r],blockNumber:i}),{tickLower:h,tickUpper:N}=D(f),S=X(e),[k,I]=await Promise.all([n.readContract({address:q,abi:K,functionName:"getPositionInfo",args:[S,C,h,N,x(r,{size:32})],blockNumber:i}),n.readContract({address:q,abi:K,functionName:"getFeeGrowthInside",args:[S,h,N],blockNumber:i})]);[v,m,a]=[e.currency0,e.currency1,k[0]],[d,u]=[G(I[0],k[1],a),G(I[1],k[2],a)]}else if(t.version==="v3"){let e=z(await n.readContract({address:b.positionManager,abi:W,functionName:"positions",args:[r],blockNumber:i})),f=await n.readContract({address:b.factory,abi:j,functionName:"getPool",args:[e.token0,e.token1,e.fee],blockNumber:i}),[h,N,S,k,I]=await Promise.all([n.readContract({address:f,abi:A,functionName:"slot0",blockNumber:i}),n.readContract({address:f,abi:A,functionName:"feeGrowthGlobal0X128",blockNumber:i}),n.readContract({address:f,abi:A,functionName:"feeGrowthGlobal1X128",blockNumber:i}),n.readContract({address:f,abi:A,functionName:"ticks",args:[e.tickLower],blockNumber:i}),n.readContract({address:f,abi:A,functionName:"ticks",args:[e.tickUpper],blockNumber:i})]),M=(L,E,H)=>P(P(L,h[1]>=e.tickLower?E:P(L,E)),h[1]<e.tickUpper?H:P(L,H));[v,m,a]=[e.token0,e.token1,e.liquidity],[w,p]=[e.tokensOwed0,e.tokensOwed1],[d,u]=[G(M(N,k[2],I[2]),e.feeGrowthInside0LastX128,a,e.tokensOwed0),G(M(S,k[3],I[3]),e.feeGrowthInside1LastX128,a,e.tokensOwed1)]}else throw new c('Provide version "v3" or "v4" for fee reads.');let[o,g]=await Promise.all([F(s,v,i),F(s,m,i)]),y=[{token:o,amount:d.toString()},{token:g,amount:u.toString()}],l=t.includeHistory===!0?await te(s,r,i,d,u):void 0;return{version:t.version,tokenId:r.toString(),owner:_,blockNumber:i.toString(),liquidity:a.toString(),...t.version==="v4"?{uncollected:y}:{},collectable:y,feeGrowthAccrual:[{token:o,amount:(d-w).toString()},{token:g,amount:(u-p).toString()}],tokensOwed:[{token:o,amount:w.toString()},{token:g,amount:p.toString()}],...l?{lifetimeFees:[{token:o,amount:l[0].toString()},{token:g,amount:l[1].toString()}]}:{},summary:"One-block collectable estimate, excluding gas. V3 tokensOwed may include withdrawn principal; feeGrowthAccrual excludes those stored amounts. V4 hook accounting can change actual collections. V4 current liquidity times lifetime range growth is not lifetime position earnings."}}}]}}var Y=V(["event IncreaseLiquidity(uint256 indexed tokenId,uint128 liquidity,uint256 amount0,uint256 amount1)","event DecreaseLiquidity(uint256 indexed tokenId,uint128 liquidity,uint256 amount0,uint256 amount1)","event Collect(uint256 indexed tokenId,address recipient,uint256 amount0,uint256 amount1)"]);async function te(s,t,r,n,i){let _=s.clientFor(O),v=Y.map(o=>Z(o)),m=0n,a=0n,d=0n,u=0n,w=0;for(let o=0n;o<=r;o+=10000000n){let g=o+9999999n<r?o+9999999n:r,y=await _.request({method:"eth_getLogs",params:[{address:b.positionManager,topics:[v,x(t,{size:32})],fromBlock:x(o),toBlock:x(g)}]});if(!Array.isArray(y))throw new c("V3 lifetime fee history is unavailable; do not treat missing history as zero earnings.");for(let l of y){if(!T(l.address,b.positionManager))throw new c("Unexpected contract in v3 lifetime fee history.");let e=J({abi:Y,data:l.data,topics:l.topics});if(e.args.tokenId!==t)throw new c("Unexpected NFT in v3 fee history.");e.eventName==="Collect"?(m+=e.args.amount0,a+=e.args.amount1):e.eventName==="DecreaseLiquidity"?(d+=e.args.amount0,u+=e.args.amount1):w++}}if(w===0)throw new c("V3 mint/increase history is missing for this existing NFT; lifetime earnings are unknown.");let p=[m+n-d,a+i-u];if(p.some(o=>o<0n))throw new c("V3 fee history is incomplete or inconsistent; lifetime earnings are unknown.");return p}export{K as a,P as b,G as c,ue as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{i as g,j as k}from"./EXRKBBX2.js";import{d as p,f}from"./VFSRRDLY.js";import{q as m}from"./2MSQ6JII.js";import{c as u,f as h}from"./L62M7LOB.js";import{a as d}from"./AXYOJBX6.js";import{g as l}from"./73N3TOJL.js";import{a as i}from"./5YS5V2LK.js";var w=["hoodlock_lock","hoodlock_burn","hoodlock_airdrop_create","hoodlock_airdrop_claim",...p,...u];async function H(e,r,t,s){if(!w.includes(e))throw new i("Unknown HoodLock action; nothing was signed.");let o=async()=>{throw new i("HoodLock does not require a swap for this action.")},n=d({clientFor:()=>s,http:fetch,preview:async a=>({txs:a,changes:[],summary:"Locally reconstructed HoodLock intent."}),quoteSwap:o,buildSwap:o}),c=await[g(n),k(n),...m(n).tools,...f(n).tools,...h(n).tools].find(a=>a.name===e).execute(r,t);if(!Array.isArray(c.txs)||c.txs.length===0)throw new i("HoodLock action has no transactions; use the read route.");return c.txs.map(a=>({...a}))}function I(e,r){if(!r.length||e.length!==r.length||e.some((t,s)=>{let o=r[s];return t.chainId!==o.chainId||!l(t.to,o.to)||!l(t.data,o.data)||t.value!==o.value}))throw new i("HoodLock transaction differs from the locally reconstructed request; nothing was signed.")}export{w as a,H as b,I as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as t}from"./TCPPYBGQ.js";import{c as o}from"./JPOYTTTW.js";function s(e,n,a){return t(e,n,a,o)}export{s as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as H}from"./HOEQVPY7.js";import{d as h}from"./V2OOOV6B.js";import{a as E}from"./MYBDO5SA.js";import{a as m}from"./5YS5V2LK.js";var O="https://heyresearch.xyz/api/v1/scan",T=2500,D=6e4,S=64,L=32768,x=/^0x[0-9a-fA-F]{40}$/,$=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u;function R(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var f=class extends m{};function j(e,t){return e===401||e===403?new f(`HEY Research Lab refused access (HTTP ${e}). Ask the Oak operator to check HEY access and allowance.`):(e===400||e===422)&&(/^\/api\/v1\/(?:scan|builder)\?/.test(t)||t.startsWith("/api/agent/research_project?address="))?new f(`HEY Research Lab rejected this token identity on chain 4663 (HTTP ${e}). Check the token contract address.`):new f(`HEY Research Lab rejected the request (HTTP ${e}). Check the project, token address and selectors.`)}var z=/\.(?:localhost|local|localdomain|internal|intranet|lan|home|corp|private|home\.arpa)$/;function P(e){let t=e.toLowerCase().replace(/\.$/,"");return!t||t.startsWith("[")||/^[\d.]+$/.test(t)||!t.includes(".")||t==="localhost"||z.test(t)?!1:/^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/.test(t)&&/[a-z]/.test(t.slice(t.lastIndexOf(".")+1))}function A(e,t=!1){if(typeof e!="string"||e.length>2048||/[\s<>\\]/.test(e)||$.test(e))return!1;try{let r=new URL(e);return r.protocol==="https:"&&!r.username&&!r.password&&(t?r.origin==="https://heyresearch.xyz"&&r.pathname.startsWith("/project/"):P(r.hostname))}catch{return!1}}function I(e){return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)&&Number.isFinite(Date.parse(e))&&new Date(e).toISOString().slice(0,10)===e&&e<=new Date(Date.now()+864e5).toISOString().slice(0,10)}function Y(e){if(typeof e!="string"||!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?Z$/.test(e))return!1;let t=Date.parse(e);return Number.isFinite(t)&&new Date(t).toISOString().slice(0,19)===e.slice(0,19)&&t<=Date.now()+3e5}function v(e,t,r){if(t!==4663||!x.test(r)||!R(e)||e.chainId!==t||typeof e.contractAddress!="string"||e.contractAddress.toLowerCase()!==r.toLowerCase())return;let a={chainId:4663,contractAddress:e.contractAddress};if(e.found===!1)return Object.freeze({found:!1,...a});if(e.found!==!0||!h(e.status_label,80)||!h(e.status_help,300)||typeof e.verified_builder!="boolean"||typeof e.activity_applies_to_token!="boolean"||typeof e.token_verification!="string"||!/^[A-Z][A-Z_]{0,63}$/.test(e.token_verification)||!A(e.project_link,!0)||!R(e.activity))return;let s=e.activity.last_ship,o=e.activity.last_ship_url;if(s!=null&&!I(s)||o!=null&&!A(o))return;let i=e.as_of;if(!(i!==void 0&&!Y(i))&&s!=null==(o!=null))return Object.freeze({found:!0,...a,status_label:e.status_label,status_help:e.status_help,verified_builder:e.verified_builder,token_verification:e.token_verification,activity_applies_to_token:e.activity_applies_to_token,project_link:e.project_link,...i===void 0?{}:{as_of:i},activity:Object.freeze({last_ship:s??null,last_ship_url:o??null})})}async function N(e,t){if(!e.ok||!e.body)throw new Error("HEY unavailable");let r=e.body.getReader(),a=()=>{r.cancel().catch(()=>{})};t.addEventListener("abort",a,{once:!0}),t.aborted&&a();let s=new TextDecoder("utf-8",{fatal:!0}),o="",i=0;try{for(;;){let{done:c,value:d}=await r.read();if(c)break;if(i+=d.byteLength,i>L)throw new Error("HEY response too large");o+=s.decode(d,{stream:!0})}return JSON.parse(o+s.decode())}finally{t.removeEventListener("abort",a),a()}}function U(e,t=fetch){if(!/^[0-9A-Za-z.+-]{1,64}$/.test(e))throw new Error("Invalid integration version");let r=new Map,a=new Map,s=H();return async(o,i)=>{if(o!==4663||!x.test(i)||/^0x(?:0{40}|e{40})$/i.test(i))return{status:"unavailable"};if(s.blocked())return{status:"unavailable"};let c=`${o}:${i.toLowerCase()}`,d=r.get(c);if(d&&d.expires>Date.now())return d.result;r.delete(c);let _=a.get(c);if(_)return _;if(a.size>=S)return{status:"unavailable"};let b=(async()=>{let p=new AbortController,w;try{let u=new Promise((l,n)=>{w=setTimeout(()=>{s.defer(null),p.abort(),n(new Error("HEY deadline"))},T)}),C=(async()=>{let l=new URL(O);l.searchParams.set("chain",String(o)),l.searchParams.set("token",i);let n;try{n=await t(l,{method:"GET",headers:{"x-hey-integration":`oak-agent-kit/${e}`},signal:p.signal,credentials:"omit",redirect:"error",referrerPolicy:"no-referrer"})}catch(y){if(y instanceof E)n=y.response;else throw s.defer(null),y}if(n.status===429||n.status>=500)throw s.defer(n.headers.get("retry-after")),n.body?.cancel().catch(()=>{}),new Error("HEY unavailable");if(n.status>=400&&n.status<500)throw n.body?.cancel().catch(()=>{}),j(n.status,"/api/v1/scan?");let k=v(await N(n,p.signal),o,i);if(!k)throw new Error("Invalid HEY response");return Object.freeze({status:"ok",card:k})})(),g=await Promise.race([C,u]);for(let[l,n]of r)n.expires<=Date.now()&&r.delete(l);return r.size>=S&&r.delete(r.keys().next().value),r.set(c,{expires:Date.now()+D,result:g}),g}catch(u){if(u instanceof f)throw u;return{status:"unavailable"}}finally{clearTimeout(w)}})();a.set(c,b);try{return await b}finally{a.delete(c)}}}export{j as a,v as b,U as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as V,H as W,I as D,L as X,a as w,z as B}from"./
|
|
1
|
+
import{C as V,H as W,I as D,L as X,a as w,z as B}from"./TMGWXDCZ.js";import{a as Q}from"./UWOFA6GV.js";import{f as J,g as E}from"./73N3TOJL.js";import{a as K,c as U}from"./RETS2ZEK.js";import{a as b}from"./G6HCV67X.js";import{a as r}from"./5YS5V2LK.js";import{encodeFunctionData as ee,erc20Abi as oe,getAddress as I,parseAbi as te}from"viem";var N="https://hookr.fun/api/mcp",Y=te(["function fill(uint256 orderId) returns (uint256)","function fillGasFloor(uint256 orderId) view returns (uint256)"]),P={type:"string",pattern:"^[1-9][0-9]*$"},Z={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},ne={cursor:P,limit:{type:"integer",minimum:1,maximum:32}};function C(t,m){if(typeof t!="string"||!/^[1-9][0-9]*$/.test(t)||t.length>78||BigInt(t)>=1n<<256n)throw new r(`Provide ${m} as a positive decimal integer string.`);return BigInt(t)}function h(t){return J(t,"Hookr returned an invalid read response. Retry later.")}function v(t,m,e,o){return{name:t,inputSchema:{type:"object",description:`Read ${t.replace("hookr_","Hookr ")}. No signature or transaction.`,properties:m,required:e,additionalProperties:!1},execute:async(n,s)=>{if(Object.keys(n).some(a=>!Object.hasOwn(m,a))||e.some(a=>n[a]===void 0))throw new r(`Provide the documented arguments for ${t}.`);return o(n,s)}}}function F(t){if(typeof t!="string"||!/^0x[0-9a-fA-F]{64}$/.test(t))throw new r("Provide a 32-byte Hookr poolId.");return t}function $(t,m){let e=h(t),o=h(e.key);if(typeof o.fee!="number"||!Number.isInteger(o.fee)||o.fee<0||o.fee>16777215||typeof o.tickSpacing!="number"||!Number.isInteger(o.tickSpacing)||o.tickSpacing<=0||o.tickSpacing>8388607)throw new r("Hookr pool key is invalid.");let n={currency0:I(String(o.currency0)),currency1:I(String(o.currency1)),fee:o.fee,tickSpacing:o.tickSpacing,hooks:I(String(o.hooks))},s=m??F(e.poolId);if(BigInt(n.currency0)>=BigInt(n.currency1)||!E(V(n),s))throw new r("Hookr pool key does not match its PoolId.");let a=h(e.token),u=h(e.quote),c=i=>{let k=I(String(i.address));if(typeof i.symbol!="string"||!i.symbol.trim()||typeof i.decimals!="number"||!Number.isInteger(i.decimals)||i.decimals<0||i.decimals>255||![n.currency0,n.currency1].includes(k))throw new r("Hookr listed token metadata is invalid.");return{...i,address:k,chainId:b}},d=c(a),l=c(u);if(d.address===l.address)throw new r("Hookr listed token pair is invalid.");return{...e,poolId:s,key:n,token:d,quote:l}}async function re(t,m,e){try{let o=await t.http(N,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:m,arguments:e}}),signal:AbortSignal.timeout(15e3),redirect:"error"});if(!o.ok)throw new Error(`HTTP ${o.status}`);let n=h(await o.json());if(n.error||n.id!==1)throw new Error("RPC failure");let s=h(n.result);if(s.isError)throw new Error("Tool failure");let a=h(s.structuredContent);if(a.status==="unavailable"||a.error)throw new Error("Unavailable");return a}catch{throw new r(`Hookr ${m} read is unavailable. Retry later; unavailable data is not an empty result.`)}}var O=re;function me(t){let m=e=>v(e?"hookr_orders":"hookr_open_orders",ne,[],async(o,n)=>{let s=o.limit??16;if(typeof s!="number"||!Number.isInteger(s)||s<1||s>32)throw new r("Hookr page limit must be an integer from 1 to 32.");let a=t.clientFor(b),u=await a.getBlock();if(typeof u.number!="bigint"||typeof u.timestamp!="bigint"||u.timestamp<=0n)throw new r("Hookr order reads need a valid chain block and timestamp.");let c=new Proxy(X(a),{get(y,f,p){return f==="readContract"?g=>y.readContract({...g,blockNumber:u.number}):Reflect.get(y,f,p)}}),d={...t,clientFor:()=>c},l=await c.readContract({address:w,abi:B,functionName:"lastOrderId"});if(typeof l!="bigint"||l<0n)throw new r("Could not read the last Hookr order ID. Coverage is unknown.");let i=o.cursor===void 0?l:C(o.cursor,"cursor");if(i>l)throw new r("Hookr cursor exceeds the latest order ID. Restart pagination.");let k=[],T=new Map,A=i,S=i>BigInt(s)?i-BigInt(s):0n;for(;i>S;){let y=i--,f=W(await c.readContract({address:w,abi:B,functionName:"getOrder",args:[y]}));if(Number(f.status)===0||BigInt(f.owner)===0n)throw new r(`Hookr order #${y} is missing. Coverage is unknown.`);if(e?!E(f.owner,n):Number(f.status)!==1)continue;let p=await D(d,y,{order:f,tokens:T});if(e){k.push(p);continue}let g=null,q=null,M=null,j=null,z=BigInt(p.expiry)<u.timestamp,G=p.fillable&&!z;if(G)try{let _=await c.readContract({address:w,abi:Y,functionName:"fillGasFloor",args:[BigInt(p.orderId)]}),R=await a.estimateGas({account:n,to:w,data:ee({abi:Y,functionName:"fill",args:[BigInt(p.orderId)]}),blockNumber:u.number}),H=await a.getGasPrice();if(typeof _!="bigint"||_<0n||typeof R!="bigint"||R<=0n||typeof H!="bigint"||H<0n)throw new Error("Invalid gas data");let L=(_*6n+4n)/5n,x=R>L?R:L;g=x.toString(),q=H.toString(),M=(x*H).toString(),j=(BigInt(p.bounty)-x*H).toString()}catch{}k.push({...p,fillable:G,expired:z,economics:{gasLimit:g,gasPrice:q,estimatedGasCost:M,bountyLessEstimatedGas:j,note:"Estimate only; excludes bounty claim gas and competition. Recheck the fill preview."}})}return{chainId:b,book:w,blockNumber:u.number.toString(),chainTime:u.timestamp.toString(),orders:k,scanned:{from:A.toString(),through:(i+1n).toString()},nextCursor:i>0n?i.toString():null,complete:i===0n}});return[m(!1),m(!0),v("hookr_order",{orderId:P},["orderId"],async e=>D(t,C(e.orderId,"orderId"))),v("hookr_pools",{token:{type:"string"},limit:{type:"integer",minimum:1,maximum:50},cursor:{type:"string",pattern:"^[0-9]{1,6}$"}},[],async e=>{if(e.token!==void 0)try{I(String(e.token))}catch{throw new r("Provide a valid token address.")}if(e.limit!==void 0&&(typeof e.limit!="number"||!Number.isInteger(e.limit)||e.limit<1||e.limit>50))throw new r("Pool page limit must be from 1 to 50.");if(e.cursor!==void 0&&(typeof e.cursor!="string"||!/^[0-9]{1,6}$/.test(e.cursor)))throw new r("Provide the pool nextCursor from the previous page.");let o=await O(t,"hookr_pools",e);if(!Array.isArray(o.pools))throw new r("Hookr pool coverage is unknown. Retry later.");return{...o,pools:o.pools.map(n=>$(n)),chainId:b,source:N}}),v("hookr_pool",{poolId:Z,side:{type:"string",enum:["buy","sell"]},amountIn:P,minAmountOut:P},["poolId"],async e=>{let o=F(e.poolId),n=[e.side,e.amountIn,e.minAmountOut].some(g=>g!==void 0);if(n&&(e.side!=="buy"&&e.side!=="sell"||e.amountIn===void 0||e.minAmountOut===void 0))throw new r("Provide side, amountIn and minAmountOut together for order-specific bounty bounds.");let s=n?C(e.amountIn,"amountIn"):void 0,a=n?C(e.minAmountOut,"minAmountOut"):void 0;if(s!==void 0&&(s>=1n<<128n||a>=1n<<128n))throw new r("Hookr order amounts must fit uint128 base units.");let u=await O(t,"hookr_pool",{poolId:o}),c=u.listing?$(u.listing,o):void 0,d={...u,...c?{listing:c}:{},chainId:b,source:N};if(!n)return{...d,bountyBounds:{status:"requires-order-terms",note:"The keeper bounty floor depends on the order. Supply side, amountIn and minAmountOut in base units. The batch-1 0.0005 ETH observation is not a permanent floor."}};if(!c)throw new r("Hookr pool key is unavailable; bounty floor is unknown.");let l=c.key,i=h(e.side==="buy"?c.quote:c.token),k=I(String(i.address))===l.currency0,T=t.clientFor(b),A=await T.getBlock(),S=await T.readContract({address:w,abi:B,functionName:"bountyBounds",args:[l,k,s,a],blockNumber:A.number});if(!Array.isArray(S)||S.length!==3||S.some(g=>typeof g!="bigint"||g<0n||g>=1n<<128n))throw new r("Hookr bounty bounds are unavailable; the floor is unknown.");let[y,f,p]=S;return{...d,bountyBounds:{status:"available",blockNumber:A.number.toString(),token:{address:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",symbol:"ETH",decimals:18,chainId:b},minBounty:y.toString(),defaultBounty:f.toString(),maxBounty:p.toString(),effectiveFloor:(y>0n?y:f).toString(),note:"ETH wei for this order at this block. Oak create uses the positive minimum, or the default when minimum is zero; recheck at creation."}}}),v("hookr_quote",{poolId:Z,side:{type:"string",enum:["buy","sell"]},amountIn:Q()},["poolId","side","amountIn"],async(e,o)=>{let n=F(e.poolId);if(e.side!=="buy"&&e.side!=="sell")throw new r("Hookr side must be buy or sell.");if(typeof e.amountIn!="string"||K(e.amountIn)<=0n)throw new r("Provide a positive amountIn in base units.");let s=await O(t,"hookr_pool",{poolId:n}),a=$(s.listing,n),u=h(e.side==="buy"?a.quote:a.token),c=I(String(u.address)),d=c==="0x0000000000000000000000000000000000000000"?18:await t.clientFor(b).readContract({address:c,abi:oe,functionName:"decimals"});if(typeof d!="number"||!Number.isInteger(d)||d<0||d>255||typeof u.symbol!="string")throw new r("Hookr input token metadata is unavailable.");let l=U(e.amountIn,d),i=await O(t,"hookr_quote",{poolId:n,side:e.side,amount:l,payer:o}),k=await O(t,"hookr_check_trade",{poolId:n,side:e.side,amount:l,wallet:o});return{chainId:b,source:N,input:{token:{address:c,symbol:u.symbol,decimals:d,chainId:b},amount:e.amountIn},quote:i,check:k,note:"Informational quote. Review pool rules; unknown trade checks do not authorize a trade."}})]}export{re as a,me as b};
|