@oakagentkit/core 0.2.1 → 0.2.3
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/{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/{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/{BEPSWFJX.js → ASDKY5NX.js} +1 -1
- package/build/dist/chunks/{5LQBHXFA.js → BX7XQANB.js} +1 -1
- package/build/dist/chunks/{NUTHT4FE.js → CE7D6MUS.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/{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/{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/{7US6PD56.js → G3MHDTGT.js} +1 -1
- package/build/dist/chunks/G6HCV67X.js +1 -0
- package/build/dist/chunks/GCWA4Z3W.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/{AYM5L6L7.js → J3GFCBZZ.js} +1 -1
- package/build/dist/chunks/{T3MGNKA6.js → JPOYTTTW.js} +1 -1
- package/build/dist/chunks/{AZGMF26W.js → JST5JGAP.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/LKJBMHCE.js +1 -0
- package/build/dist/chunks/{FKAA7VUR.js → LLM5WDM3.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/MKQVS3IO.js +1 -0
- 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/O5IVZHHP.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/{NCEJZWGX.js → PEA32CWB.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/{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/{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/{67TJOOBI.js → TLJPVYRJ.js} +1 -1
- package/build/dist/chunks/{ULJ6E4HP.js → TMGWXDCZ.js} +1 -1
- package/build/dist/chunks/TNLHMDWL.js +1 -0
- package/build/dist/chunks/{NMFVXBTL.js → TNSKEHPC.js} +1 -1
- package/build/dist/chunks/TPDOUL4N.js +1 -0
- 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/VCLPOU7T.js +1 -0
- package/build/dist/chunks/{BG4S6MSN.js → VFKNXQXI.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/{C3ZZSGSP.js → XQUPZ3GU.js} +1 -1
- package/build/dist/chunks/XQXLFF7Y.js +1 -0
- package/build/dist/chunks/XUYHMOHS.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/{NKY3DT34.js → YA5WWDEW.js} +1 -1
- package/build/dist/chunks/YHB55C5T.js +1 -0
- package/build/dist/chunks/YOENHHKI.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/ZXQMF56D.js +1 -0
- 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/JG24LNUI.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/RRSODRGT.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
|
@@ -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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as pe,c as De}from"./SQ5BNSXR.js";import{c as Te,d as a,r as xe}from"./53N7PNJH.js";import{o as ce}from"./CAU44UWP.js";import{a as M}from"./VJ3W2V3B.js";import{a as ve}from"./6IM6A5VA.js";import{a as te}from"./UWOFA6GV.js";import{c as H,j as Ce}from"./73N3TOJL.js";import{a as ke}from"./RETS2ZEK.js";import{a as R,i as qe}from"./XPFVT2EA.js";import{a as e}from"./5YS5V2LK.js";import{decodeFunctionData as Ee,erc20Abi as Ne}from"viem";var je="https://api.relay.link",q="0x0000000000000000000000000000000000000000",Le=60,Se=30,n=qe[R].relay.depository.address.toLowerCase(),ne="0x59916da825d2d2ec1bf878d71c88826f6633ecca",Oe=new Map([[1,{chainId:"ethereum",depository:n}],[10,{chainId:"optimism",depository:n}],[25,{chainId:"cronos",depository:ne}],[56,{chainId:"bnb",depository:n}],[100,{chainId:"gnosis",depository:n}],[130,{chainId:"unichain",depository:n}],[137,{chainId:"polygon",depository:n}],[143,{chainId:"monad",depository:n}],[146,{chainId:"sonic",depository:n}],[169,{chainId:"manta",depository:n}],[196,{chainId:"xlayer",depository:n}],[288,{chainId:"boba",depository:n}],[324,{chainId:"zksync",depository:n}],[360,{chainId:"shape",depository:n}],[480,{chainId:"worldchain",depository:n}],[747,{chainId:"flow",depository:n}],[988,{chainId:"stable",depository:n}],[999,{chainId:"hyperevm",depository:n}],[1088,{chainId:"metis",depository:ne}],[1135,{chainId:"lisk",depository:n}],[1868,{chainId:"soneium",depository:n}],[2020,{chainId:"ronin",depository:n}],[2741,{chainId:"abstract",depository:n}],[2818,{chainId:"morph",depository:n}],[4217,{chainId:"tempo",depository:n}],[4326,{chainId:"megaeth",depository:n}],[5e3,{chainId:"mantle",depository:ne}],[5031,{chainId:"somnia",depository:n}],[5042,{chainId:"arc",depository:n}],[8453,{chainId:"base",depository:n}],[9745,{chainId:"plasma",depository:n}],[33139,{chainId:"apechain",depository:n}],[34443,{chainId:"mode",depository:n}],[42018,{chainId:"mythos",depository:n}],[42161,{chainId:"arbitrum",depository:n}],[42220,{chainId:"celo",depository:n}],[43114,{chainId:"avalanche",depository:n}],[48900,{chainId:"zircuit",depository:n}],[57073,{chainId:"ink",depository:n}],[59144,{chainId:"linea",depository:ne}],[60808,{chainId:"bob",depository:n}],[80094,{chainId:"berachain",depository:n}],[97477,{chainId:"doma",depository:n}],[98866,{chainId:"plume",depository:n}],[534352,{chainId:"scroll",depository:n}],[685689,{chainId:"gensyn",depository:n}],[747474,{chainId:"katana",depository:n}],[5064014,{chainId:"ethereal",depository:n}],[7777777,{chainId:"zora",depository:n}]]);function nt(t){return Oe.get(t)?.depository}function F(t){return Ce(t,"Provide a token or wallet address.")}function I(t){let o=F(t);return o===M?q:o}function f(t,o){return F(t)===F(o)}function l(t){if(typeof t!="string")throw new e("Provide a decimal base-unit amount string.");return ke(t),t}function oe(t){let o=l(t);if(BigInt(o)<=0n)throw new e("Provide a positive base-unit amount.");return o}function ze(t){if(typeof t!="number"||!Number.isSafeInteger(t)||t<=0)throw new e("Provide a positive integer origin chain ID.");return t}function Pe(t,o){if(typeof t!="number"||!Number.isSafeInteger(t)||t<=0)throw new e(`${o} is missing or invalid.`);return t}async function G(t,o,c,i,p){let r=a(c);if(r.chainId!==i||I(r.address)!==p||typeof r.symbol!="string"||!/^[A-Za-z0-9._-]{1,32}$/.test(r.symbol))throw new e("Relay quote token metadata does not match the requested chain and address.");if(p===q){if(r.decimals!==18)throw new e("Native token decimals must be 18.");return{address:M,chainId:i,symbol:r.symbol,decimals:18}}let g=`${i}:${p}`,m=o.get(g);if(m===void 0){let d=await t.clientFor(i).readContract({address:p,abi:Ne,functionName:"decimals"}),w=typeof d=="bigint"?Number(d):d;if(typeof w!="number"||!Number.isInteger(w)||w<0||w>255)throw new e("Could not read valid ERC-20 decimals() on-chain.");m=w,o.set(g,m)}return{address:p,chainId:i,symbol:r.symbol,decimals:m}}async function Ke(t,o,c,i,p,r,g){if(c.swap===void 0)return[];let m=a(c.swap),d=a(m.from);if(d.chainId!==p)throw new e("The swap prerequisite token must be on the origin chain.");let w=await G(t,o,d,p,I(d.address)),j=r===q?M:r;if(f(w.address,j))throw new e("The swap prerequisite must use a different input token.");let me=oe(m.amountIn),y=m.slippageBps;if(y!==void 0&&(typeof y!="number"||!Number.isInteger(y)||y<0||y>1e4))throw new e("Provide swap slippage in basis points from 0 to 10000.");let E=await t.quoteSwap({from:w.address,to:j,amountIn:me,...y===void 0?{}:{slippageBps:y}},i);if(BigInt(l(E.expiresAt))<=BigInt(Math.floor(Date.now()/1e3)))throw new e("The swap prerequisite quote expired. Request a fresh quote.");if(BigInt(l(E.minAmountOut))<BigInt(g))throw new e("The swap prerequisite minimum cannot cover the bridge amount.");let k=await t.buildSwap(E.quoteId,i);if(!("txs"in k)||!k.txs.length)throw new e("The swap prerequisite must return unsigned transactions.");if(k.txs.some(S=>S.chainId!==p))throw new e("The injected swap coordinator does not support this origin chain.");return k.txs.map(S=>t.unsignedTx(S))}async function Ue(t,o,c){ve(c);let i=ze(o.originChainId);if(i===R)throw new e("Inbound bridging requires an origin chain other than 4663.");let p=Oe.get(i);if(!p)throw new e("Relay inbound does not support this origin chain.");if(o.destinationChainId!==void 0&&o.destinationChainId!==R)throw new e("Inbound bridge destination must be chain 4663.");let r=I(o.originCurrency??M),g=I(o.destinationCurrency??M),m=F(o.recipient??c),d=oe(o.amount),w=o.minAmountOut===void 0?void 0:l(o.minAmountOut),j=o.slippageBps===void 0?pe:o.slippageBps;if(ce("0",j),await t.clientFor(i).getChainId()!==i)throw new e("The RPC chain does not match the inbound origin chain.");let y=new Map,E=await Ke(t,y,o,c,i,r,d),k,S=process.env.OAK_RELAY_API_KEY?.trim();if(!S)throw new e("Configure OAK_RELAY_API_KEY on the server: Relay quote/v2 requires a valid API key since October 2, 2026. Status and chain reads remain available without it.");try{let s=await t.http(`${je}/quote/v2`,{method:"POST",headers:{"content-type":"application/json","user-agent":"oak-core/0.1.0","x-api-key":S},body:JSON.stringify({user:c,recipient:m,originChainId:i,destinationChainId:R,originCurrency:r,destinationCurrency:g,amount:d,tradeType:"EXACT_INPUT",...r===q?{}:{explicitDeposit:!0}})});if(!s.ok)throw new Error("Relay HTTP failure.");k=await s.json()}catch{throw new e("Relay quote request failed. Please try again.")}let b=a(k);if(typeof b.requestId!="string"||!/^0x[0-9a-fA-F]{64}$/.test(b.requestId))throw new e("Relay returned an invalid request ID.");let P=b.requestId,he=`/intents/status/v3?requestId=${P}`,L=a(b.details);if(!f(L.sender,c)||!f(L.recipient,m))throw new e("Relay quote sender or recipient does not match the request.");let ye=a(L.currencyIn),ie=a(L.currencyOut),N=await G(t,y,ye.currency,i,r),O=await G(t,y,ie.currency,R,g);if(l(ye.amount)!==d)throw new e("Relay quote input amount does not match the request.");let _=oe(ie.amount),C=oe(ie.minimumAmount);if(BigInt(C)>BigInt(_))throw new e("Relay quote minimum output exceeds the expected output.");if(w!==void 0){if(C!==w)throw new e("Relay order minimum must exactly match minAmountOut. Request a new quote.")}else{let s=ce(_,j);if(BigInt(C)<BigInt(s))throw De(_,C)}let le=a(a(b.fees).relayer),fe=a(le.currency),Q=await G(t,y,fe,i,I(fe.address)),we={token:Q,amount:l(le.amount)},Ie=a(L.refundCurrency),_e=a(Ie.currency),z=await G(t,y,_e,i,r),re=l(Ie.amount),K=a(a(b.protocol).v2);if(typeof K.orderId!="string"||!/^0x[0-9a-fA-F]{64}$/.test(K.orderId))throw new e("Relay returned an invalid order ID.");let V=K.orderId.toLowerCase(),W=a(K.paymentDetails),$=F(W.depository);if(W.chainId!==p.chainId||$!==p.depository||I(W.currency)!==r||l(W.amount)!==d)throw new e("Relay payment details do not match the origin chain depository and input.");let J=a(K.orderData),v=a(J.output);if(v.chainId!=="robinhood"||!Array.isArray(v.calls)||v.calls.length!==0||!Array.isArray(v.payments)||v.payments.length!==1)throw new e("Relay order output does not match destination chain 4663.");let X=a(v.payments[0]);if(!f(X.recipient,m)||I(X.currency)!==g||l(X.minimumAmount)!==C||l(X.expectedAmount)!==_)throw new e("Relay order output payment does not match the quoted recipient and amounts.");let se=Pe(v.deadline,"Relay order output deadline");if(!Array.isArray(J.inputs)||!J.inputs.length)throw new e("Relay order has no inputs.");let Z=[],ae=[];for(let s of J.inputs){let u=a(s),x=a(u.payment);if(x.chainId!==p.chainId||I(x.currency)!==r||l(x.amount)!==d||!Array.isArray(u.refunds)||!u.refunds.length)throw new e("Relay order input does not match the quoted input.");for(let D of u.refunds){let h=a(D);if(!f(h.recipient,c))throw new e("Relay refund recipient does not match the agent wallet. Request a new quote.");if(Z.push(Pe(h.deadline,"Relay order refund deadline")),ae.push(l(h.minimumAmount)),!(h.chainId===p.chainId?f(h.recipient,c)&&I(h.currency)===r:h.chainId==="robinhood"&&I(h.currency)===g))throw new e("Relay order refund terms do not match the sender or recipient.")}}let ge=Math.min(se,...Z),U=0,be=()=>{let s=Math.floor(Date.now()/1e3),u=U||s+Le;if(ge-s<=Se)throw new e("Relay order deadline is expired or too soon to sign safely. Request a new quote.");if(U=Math.min(u,ge-Se),U<=s)throw new e("Relay quote expired before signing. Request a new quote.")};if(be(),!Array.isArray(b.steps)||!b.steps.length)throw new e("Relay returned no origin transactions.");let T=[];for(let s of b.steps){let u=a(s);if(u.kind!=="transaction"||u.requestId!==P||!Array.isArray(u.items)||!u.items.length)throw new e("Relay returned an unsupported origin step.");for(let x of u.items){let D=a(x),h=a(D.data),ue=a(D.check);if(D.status!=="incomplete"||h.chainId!==i||!f(h.from,c))throw new e("Relay transaction does not match the origin chain and sender.");if(ue.method!=="GET"||ue.endpoint!==he)throw new e("Relay status endpoint does not match the request ID.");T.push(t.unsignedTx({to:F(h.to),data:h.data,value:l(h.value),chainId:i,description:`Relay inbound deposit for request ${P}; destination chain 4663.`}))}}if(!T.length)throw new e("Relay returned no origin transactions.");if(r===q&&T.length!==1)throw new e("Relay native deposit must be a single depositNative transaction.");if(r!==q&&T.length>2)throw new e("Relay ERC-20 deposit allows at most one exact-amount approval before depositErc20.");for(let s of T.slice(0,-1)){if(!s.data.toLowerCase().startsWith("0x095ea7b3"))throw new e("Relay returned an unsupported prerequisite transaction.");let u=Ee({abi:Ne,data:s.data});if(u.functionName!=="approve")throw new e("Relay returned an invalid approval.");let[x,D]=u.args;if(r===q||!f(s.to,r)||!f(x,$)||D!==BigInt(d)||s.value!=="0")throw new e("Relay approval must authorize the exact input amount for the origin depository.");s.description=`Approve exactly ${t.formatAmount(d,N.decimals)} ${N.symbol} (${d} base units of ${r}) for ${$} on chain ${i}.`}let B=T[T.length-1],Y=r===q,ee=Y?"depositNative":"depositErc20",Ae=Y?"depositNative(address,bytes32)":"depositErc20(address,address,uint256,bytes32)";if(!f(B.to,$)||B.value!==(Y?d:"0")||!(Y?/^0x[0-9a-fA-F]{136}$/:/^0x[0-9a-fA-F]{264}$/).test(B.data))throw new e(`Relay deposit transaction does not target the origin depository with ${ee} calldata.`);let A;try{A=Ee({abi:Te,data:B.data})}catch{throw new e(`Relay deposit transaction must call ${Ae}.`)}if(A.functionName!==ee)throw new e(`Relay deposit transaction must call ${Ae}.`);let Be=A.args[0],Me=A.functionName==="depositErc20"?A.args[3]:A.args[1];if(A.functionName==="depositErc20"&&(!f(A.args[1],r)||A.args[2]!==BigInt(d)))throw new e("Relay depositErc20 token or amount does not match the quoted input.");if(!f(Be,c)||Me.toLowerCase()!==V)throw new e(`Relay ${ee} depositor or orderId does not match the wallet and quoted protocol.v2.orderId.`);B.description=`Relay inbound ${ee} for order ${V} (request ${P}); destination chain 4663.`;let de=Y?[]:await xe(t,r,$,d,i,c);for(let[s,u]of de.entries())u.description=de.length===2&&s===0?`Reset the existing ${N.symbol} allowance for ${$} on chain ${i} to zero.`:`Approve exactly ${t.formatAmount(d,N.decimals)} ${N.symbol} (${d} base units of ${r}) for ${$} on chain ${i}.`;let $e=[...E,...de,B],Re=await t.preview($e,c);be();let Fe=Re.changes.map(s=>{let u=s.amount.startsWith("-");return`${u?"-":""}${t.formatAmount(u?s.amount.slice(1):s.amount,s.token.decimals)} ${s.token.symbol} (${s.token.address}, chain ${s.token.chainId})`});return{txs:$e,preview:Re,requestId:P,orderId:V,depository:$,originChainId:i,destinationChainId:R,recipient:m,amountIn:{token:N,amount:d},amountOut:{token:O,amount:_},minAmountOut:C,relayerFee:we,refundCurrency:{token:z,amount:re,minimumAmounts:ae},orderDeadline:String(se),refundDeadlines:Z.map(String),expiresAt:String(U),status:"pending",statusEndpoint:he,summary:`${E.length?"Swap prerequisite first, then ":""}Relay inbound from chain ${i} to chain 4663 for ${m}; expected ${t.formatAmount(_,O.decimals)} ${O.symbol}, minimum ${t.formatAmount(C,O.decimals)} ${O.symbol} (${O.address}). Quoted relay fee ${t.formatAmount(we.amount,Q.decimals)} ${Q.symbol} (${Q.address}, chain ${i}); output is net of quoted fees. Order ${V} (request ${P}); output deadline ${se}, refund deadlines ${Z.join(", ")}, quote expires ${U}. Refund terms: details.refundCurrency quotes ${t.formatAmount(re,z.decimals)} ${z.symbol} (${re} base units) on chain ${z.chainId} (${z.address}), but protocol.v2 order refund floor is ${ae.join(", ")} base units. ${Fe.join("; ")}. Unsigned origin transactions only; destination fulfillment remains pending. Track with relay_status; timeout or refund is not fulfillment.`}}var ot=t=>({tools:[{name:"relay_bridge_in",inputSchema:{type:"object",additionalProperties:!1,required:["originChainId","amount"],properties:{originChainId:{type:"integer",minimum:1},destinationChainId:{const:R},originCurrency:H,destinationCurrency:H,amount:te(),minAmountOut:te(),slippageBps:{type:"integer",minimum:0,maximum:9999,default:pe},recipient:H,swap:{type:"object",additionalProperties:!1,required:["from","amountIn"],properties:{from:{type:"object",additionalProperties:!1,required:["address","chainId","symbol","decimals"],properties:{address:H,chainId:{type:"integer",minimum:1},symbol:{type:"string"},decimals:{type:"integer",minimum:0,maximum:255}}},amountIn:te(),slippageBps:{type:"integer",minimum:0,maximum:1e4}}}}},async execute(o,c){try{return await Ue(t,o,c)}catch(i){throw new e(t.plainError(i))}}}]});export{nt as a,ot as b};
|
|
1
|
+
import{b as pe,c as De}from"./SQ5BNSXR.js";import{c as Te,d as a,r as xe}from"./53N7PNJH.js";import{o as ce}from"./5O5ZE3ZV.js";import{a as M}from"./CY75R4FK.js";import{a as ve}from"./6IM6A5VA.js";import{a as te}from"./UWOFA6GV.js";import{c as H,j as Ce}from"./73N3TOJL.js";import{a as ke}from"./RETS2ZEK.js";import{a as R,i as qe}from"./G6HCV67X.js";import{a as e}from"./5YS5V2LK.js";import{decodeFunctionData as Ee,erc20Abi as Ne}from"viem";var je="https://api.relay.link",q="0x0000000000000000000000000000000000000000",Le=60,Se=30,n=qe[R].relay.depository.address.toLowerCase(),ne="0x59916da825d2d2ec1bf878d71c88826f6633ecca",Oe=new Map([[1,{chainId:"ethereum",depository:n}],[10,{chainId:"optimism",depository:n}],[25,{chainId:"cronos",depository:ne}],[56,{chainId:"bnb",depository:n}],[100,{chainId:"gnosis",depository:n}],[130,{chainId:"unichain",depository:n}],[137,{chainId:"polygon",depository:n}],[143,{chainId:"monad",depository:n}],[146,{chainId:"sonic",depository:n}],[169,{chainId:"manta",depository:n}],[196,{chainId:"xlayer",depository:n}],[288,{chainId:"boba",depository:n}],[324,{chainId:"zksync",depository:n}],[360,{chainId:"shape",depository:n}],[480,{chainId:"worldchain",depository:n}],[747,{chainId:"flow",depository:n}],[988,{chainId:"stable",depository:n}],[999,{chainId:"hyperevm",depository:n}],[1088,{chainId:"metis",depository:ne}],[1135,{chainId:"lisk",depository:n}],[1868,{chainId:"soneium",depository:n}],[2020,{chainId:"ronin",depository:n}],[2741,{chainId:"abstract",depository:n}],[2818,{chainId:"morph",depository:n}],[4217,{chainId:"tempo",depository:n}],[4326,{chainId:"megaeth",depository:n}],[5e3,{chainId:"mantle",depository:ne}],[5031,{chainId:"somnia",depository:n}],[5042,{chainId:"arc",depository:n}],[8453,{chainId:"base",depository:n}],[9745,{chainId:"plasma",depository:n}],[33139,{chainId:"apechain",depository:n}],[34443,{chainId:"mode",depository:n}],[42018,{chainId:"mythos",depository:n}],[42161,{chainId:"arbitrum",depository:n}],[42220,{chainId:"celo",depository:n}],[43114,{chainId:"avalanche",depository:n}],[48900,{chainId:"zircuit",depository:n}],[57073,{chainId:"ink",depository:n}],[59144,{chainId:"linea",depository:ne}],[60808,{chainId:"bob",depository:n}],[80094,{chainId:"berachain",depository:n}],[97477,{chainId:"doma",depository:n}],[98866,{chainId:"plume",depository:n}],[534352,{chainId:"scroll",depository:n}],[685689,{chainId:"gensyn",depository:n}],[747474,{chainId:"katana",depository:n}],[5064014,{chainId:"ethereal",depository:n}],[7777777,{chainId:"zora",depository:n}]]);function nt(t){return Oe.get(t)?.depository}function F(t){return Ce(t,"Provide a token or wallet address.")}function I(t){let o=F(t);return o===M?q:o}function f(t,o){return F(t)===F(o)}function l(t){if(typeof t!="string")throw new e("Provide a decimal base-unit amount string.");return ke(t),t}function oe(t){let o=l(t);if(BigInt(o)<=0n)throw new e("Provide a positive base-unit amount.");return o}function ze(t){if(typeof t!="number"||!Number.isSafeInteger(t)||t<=0)throw new e("Provide a positive integer origin chain ID.");return t}function Pe(t,o){if(typeof t!="number"||!Number.isSafeInteger(t)||t<=0)throw new e(`${o} is missing or invalid.`);return t}async function G(t,o,c,i,p){let r=a(c);if(r.chainId!==i||I(r.address)!==p||typeof r.symbol!="string"||!/^[A-Za-z0-9._-]{1,32}$/.test(r.symbol))throw new e("Relay quote token metadata does not match the requested chain and address.");if(p===q){if(r.decimals!==18)throw new e("Native token decimals must be 18.");return{address:M,chainId:i,symbol:r.symbol,decimals:18}}let g=`${i}:${p}`,m=o.get(g);if(m===void 0){let d=await t.clientFor(i).readContract({address:p,abi:Ne,functionName:"decimals"}),w=typeof d=="bigint"?Number(d):d;if(typeof w!="number"||!Number.isInteger(w)||w<0||w>255)throw new e("Could not read valid ERC-20 decimals() on-chain.");m=w,o.set(g,m)}return{address:p,chainId:i,symbol:r.symbol,decimals:m}}async function Ke(t,o,c,i,p,r,g){if(c.swap===void 0)return[];let m=a(c.swap),d=a(m.from);if(d.chainId!==p)throw new e("The swap prerequisite token must be on the origin chain.");let w=await G(t,o,d,p,I(d.address)),j=r===q?M:r;if(f(w.address,j))throw new e("The swap prerequisite must use a different input token.");let me=oe(m.amountIn),y=m.slippageBps;if(y!==void 0&&(typeof y!="number"||!Number.isInteger(y)||y<0||y>1e4))throw new e("Provide swap slippage in basis points from 0 to 10000.");let E=await t.quoteSwap({from:w.address,to:j,amountIn:me,...y===void 0?{}:{slippageBps:y}},i);if(BigInt(l(E.expiresAt))<=BigInt(Math.floor(Date.now()/1e3)))throw new e("The swap prerequisite quote expired. Request a fresh quote.");if(BigInt(l(E.minAmountOut))<BigInt(g))throw new e("The swap prerequisite minimum cannot cover the bridge amount.");let k=await t.buildSwap(E.quoteId,i);if(!("txs"in k)||!k.txs.length)throw new e("The swap prerequisite must return unsigned transactions.");if(k.txs.some(S=>S.chainId!==p))throw new e("The injected swap coordinator does not support this origin chain.");return k.txs.map(S=>t.unsignedTx(S))}async function Ue(t,o,c){ve(c);let i=ze(o.originChainId);if(i===R)throw new e("Inbound bridging requires an origin chain other than 4663.");let p=Oe.get(i);if(!p)throw new e("Relay inbound does not support this origin chain.");if(o.destinationChainId!==void 0&&o.destinationChainId!==R)throw new e("Inbound bridge destination must be chain 4663.");let r=I(o.originCurrency??M),g=I(o.destinationCurrency??M),m=F(o.recipient??c),d=oe(o.amount),w=o.minAmountOut===void 0?void 0:l(o.minAmountOut),j=o.slippageBps===void 0?pe:o.slippageBps;if(ce("0",j),await t.clientFor(i).getChainId()!==i)throw new e("The RPC chain does not match the inbound origin chain.");let y=new Map,E=await Ke(t,y,o,c,i,r,d),k,S=process.env.OAK_RELAY_API_KEY?.trim();if(!S)throw new e("Configure OAK_RELAY_API_KEY on the server: Relay quote/v2 requires a valid API key since October 2, 2026. Status and chain reads remain available without it.");try{let s=await t.http(`${je}/quote/v2`,{method:"POST",headers:{"content-type":"application/json","user-agent":"oak-core/0.1.0","x-api-key":S},body:JSON.stringify({user:c,recipient:m,originChainId:i,destinationChainId:R,originCurrency:r,destinationCurrency:g,amount:d,tradeType:"EXACT_INPUT",...r===q?{}:{explicitDeposit:!0}})});if(!s.ok)throw new Error("Relay HTTP failure.");k=await s.json()}catch{throw new e("Relay quote request failed. Please try again.")}let b=a(k);if(typeof b.requestId!="string"||!/^0x[0-9a-fA-F]{64}$/.test(b.requestId))throw new e("Relay returned an invalid request ID.");let P=b.requestId,he=`/intents/status/v3?requestId=${P}`,L=a(b.details);if(!f(L.sender,c)||!f(L.recipient,m))throw new e("Relay quote sender or recipient does not match the request.");let ye=a(L.currencyIn),ie=a(L.currencyOut),N=await G(t,y,ye.currency,i,r),O=await G(t,y,ie.currency,R,g);if(l(ye.amount)!==d)throw new e("Relay quote input amount does not match the request.");let _=oe(ie.amount),C=oe(ie.minimumAmount);if(BigInt(C)>BigInt(_))throw new e("Relay quote minimum output exceeds the expected output.");if(w!==void 0){if(C!==w)throw new e("Relay order minimum must exactly match minAmountOut. Request a new quote.")}else{let s=ce(_,j);if(BigInt(C)<BigInt(s))throw De(_,C)}let le=a(a(b.fees).relayer),fe=a(le.currency),Q=await G(t,y,fe,i,I(fe.address)),we={token:Q,amount:l(le.amount)},Ie=a(L.refundCurrency),_e=a(Ie.currency),z=await G(t,y,_e,i,r),re=l(Ie.amount),K=a(a(b.protocol).v2);if(typeof K.orderId!="string"||!/^0x[0-9a-fA-F]{64}$/.test(K.orderId))throw new e("Relay returned an invalid order ID.");let V=K.orderId.toLowerCase(),W=a(K.paymentDetails),$=F(W.depository);if(W.chainId!==p.chainId||$!==p.depository||I(W.currency)!==r||l(W.amount)!==d)throw new e("Relay payment details do not match the origin chain depository and input.");let J=a(K.orderData),v=a(J.output);if(v.chainId!=="robinhood"||!Array.isArray(v.calls)||v.calls.length!==0||!Array.isArray(v.payments)||v.payments.length!==1)throw new e("Relay order output does not match destination chain 4663.");let X=a(v.payments[0]);if(!f(X.recipient,m)||I(X.currency)!==g||l(X.minimumAmount)!==C||l(X.expectedAmount)!==_)throw new e("Relay order output payment does not match the quoted recipient and amounts.");let se=Pe(v.deadline,"Relay order output deadline");if(!Array.isArray(J.inputs)||!J.inputs.length)throw new e("Relay order has no inputs.");let Z=[],ae=[];for(let s of J.inputs){let u=a(s),x=a(u.payment);if(x.chainId!==p.chainId||I(x.currency)!==r||l(x.amount)!==d||!Array.isArray(u.refunds)||!u.refunds.length)throw new e("Relay order input does not match the quoted input.");for(let D of u.refunds){let h=a(D);if(!f(h.recipient,c))throw new e("Relay refund recipient does not match the agent wallet. Request a new quote.");if(Z.push(Pe(h.deadline,"Relay order refund deadline")),ae.push(l(h.minimumAmount)),!(h.chainId===p.chainId?f(h.recipient,c)&&I(h.currency)===r:h.chainId==="robinhood"&&I(h.currency)===g))throw new e("Relay order refund terms do not match the sender or recipient.")}}let ge=Math.min(se,...Z),U=0,be=()=>{let s=Math.floor(Date.now()/1e3),u=U||s+Le;if(ge-s<=Se)throw new e("Relay order deadline is expired or too soon to sign safely. Request a new quote.");if(U=Math.min(u,ge-Se),U<=s)throw new e("Relay quote expired before signing. Request a new quote.")};if(be(),!Array.isArray(b.steps)||!b.steps.length)throw new e("Relay returned no origin transactions.");let T=[];for(let s of b.steps){let u=a(s);if(u.kind!=="transaction"||u.requestId!==P||!Array.isArray(u.items)||!u.items.length)throw new e("Relay returned an unsupported origin step.");for(let x of u.items){let D=a(x),h=a(D.data),ue=a(D.check);if(D.status!=="incomplete"||h.chainId!==i||!f(h.from,c))throw new e("Relay transaction does not match the origin chain and sender.");if(ue.method!=="GET"||ue.endpoint!==he)throw new e("Relay status endpoint does not match the request ID.");T.push(t.unsignedTx({to:F(h.to),data:h.data,value:l(h.value),chainId:i,description:`Relay inbound deposit for request ${P}; destination chain 4663.`}))}}if(!T.length)throw new e("Relay returned no origin transactions.");if(r===q&&T.length!==1)throw new e("Relay native deposit must be a single depositNative transaction.");if(r!==q&&T.length>2)throw new e("Relay ERC-20 deposit allows at most one exact-amount approval before depositErc20.");for(let s of T.slice(0,-1)){if(!s.data.toLowerCase().startsWith("0x095ea7b3"))throw new e("Relay returned an unsupported prerequisite transaction.");let u=Ee({abi:Ne,data:s.data});if(u.functionName!=="approve")throw new e("Relay returned an invalid approval.");let[x,D]=u.args;if(r===q||!f(s.to,r)||!f(x,$)||D!==BigInt(d)||s.value!=="0")throw new e("Relay approval must authorize the exact input amount for the origin depository.");s.description=`Approve exactly ${t.formatAmount(d,N.decimals)} ${N.symbol} (${d} base units of ${r}) for ${$} on chain ${i}.`}let B=T[T.length-1],Y=r===q,ee=Y?"depositNative":"depositErc20",Ae=Y?"depositNative(address,bytes32)":"depositErc20(address,address,uint256,bytes32)";if(!f(B.to,$)||B.value!==(Y?d:"0")||!(Y?/^0x[0-9a-fA-F]{136}$/:/^0x[0-9a-fA-F]{264}$/).test(B.data))throw new e(`Relay deposit transaction does not target the origin depository with ${ee} calldata.`);let A;try{A=Ee({abi:Te,data:B.data})}catch{throw new e(`Relay deposit transaction must call ${Ae}.`)}if(A.functionName!==ee)throw new e(`Relay deposit transaction must call ${Ae}.`);let Be=A.args[0],Me=A.functionName==="depositErc20"?A.args[3]:A.args[1];if(A.functionName==="depositErc20"&&(!f(A.args[1],r)||A.args[2]!==BigInt(d)))throw new e("Relay depositErc20 token or amount does not match the quoted input.");if(!f(Be,c)||Me.toLowerCase()!==V)throw new e(`Relay ${ee} depositor or orderId does not match the wallet and quoted protocol.v2.orderId.`);B.description=`Relay inbound ${ee} for order ${V} (request ${P}); destination chain 4663.`;let de=Y?[]:await xe(t,r,$,d,i,c);for(let[s,u]of de.entries())u.description=de.length===2&&s===0?`Reset the existing ${N.symbol} allowance for ${$} on chain ${i} to zero.`:`Approve exactly ${t.formatAmount(d,N.decimals)} ${N.symbol} (${d} base units of ${r}) for ${$} on chain ${i}.`;let $e=[...E,...de,B],Re=await t.preview($e,c);be();let Fe=Re.changes.map(s=>{let u=s.amount.startsWith("-");return`${u?"-":""}${t.formatAmount(u?s.amount.slice(1):s.amount,s.token.decimals)} ${s.token.symbol} (${s.token.address}, chain ${s.token.chainId})`});return{txs:$e,preview:Re,requestId:P,orderId:V,depository:$,originChainId:i,destinationChainId:R,recipient:m,amountIn:{token:N,amount:d},amountOut:{token:O,amount:_},minAmountOut:C,relayerFee:we,refundCurrency:{token:z,amount:re,minimumAmounts:ae},orderDeadline:String(se),refundDeadlines:Z.map(String),expiresAt:String(U),status:"pending",statusEndpoint:he,summary:`${E.length?"Swap prerequisite first, then ":""}Relay inbound from chain ${i} to chain 4663 for ${m}; expected ${t.formatAmount(_,O.decimals)} ${O.symbol}, minimum ${t.formatAmount(C,O.decimals)} ${O.symbol} (${O.address}). Quoted relay fee ${t.formatAmount(we.amount,Q.decimals)} ${Q.symbol} (${Q.address}, chain ${i}); output is net of quoted fees. Order ${V} (request ${P}); output deadline ${se}, refund deadlines ${Z.join(", ")}, quote expires ${U}. Refund terms: details.refundCurrency quotes ${t.formatAmount(re,z.decimals)} ${z.symbol} (${re} base units) on chain ${z.chainId} (${z.address}), but protocol.v2 order refund floor is ${ae.join(", ")} base units. ${Fe.join("; ")}. Unsigned origin transactions only; destination fulfillment remains pending. Track with relay_status; timeout or refund is not fulfillment.`}}var ot=t=>({tools:[{name:"relay_bridge_in",inputSchema:{type:"object",additionalProperties:!1,required:["originChainId","amount"],properties:{originChainId:{type:"integer",minimum:1},destinationChainId:{const:R},originCurrency:H,destinationCurrency:H,amount:te(),minAmountOut:te(),slippageBps:{type:"integer",minimum:0,maximum:9999,default:pe},recipient:H,swap:{type:"object",additionalProperties:!1,required:["from","amountIn"],properties:{from:{type:"object",additionalProperties:!1,required:["address","chainId","symbol","decimals"],properties:{address:H,chainId:{type:"integer",minimum:1},symbol:{type:"string"},decimals:{type:"integer",minimum:0,maximum:255}}},amountIn:te(),slippageBps:{type:"integer",minimum:0,maximum:1e4}}}}},async execute(o,c){try{return await Ue(t,o,c)}catch(i){throw new e(t.plainError(i))}}}]});export{nt as a,ot as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{K as O}from"./
|
|
1
|
+
import{K as O}from"./L3ZM77SJ.js";import{a as d}from"./NAYRD43N.js";import{a as v}from"./6IM6A5VA.js";import{a as A}from"./UWOFA6GV.js";import{d as k,i as T}from"./73N3TOJL.js";import{a as p}from"./G6HCV67X.js";import{a as r}from"./5YS5V2LK.js";import{a as g}from"./JXOEJPJ4.js";import{encodeFunctionData as C,getAddress as l,parseAbi as E,zeroAddress as N}from"viem";var w=E(["function owner() view returns (address)","function paused() view returns (bool)","function maximumLoanDuration() view returns (uint256)","function adminFeeInBasisPoints() view returns (uint16)","function pause()","function unpause()","function updateAdminFee(uint16)","function updateMaximumLoanDuration(uint256)","function setERC20Permit(address,bool)","function setERC20Permits(address[],bool[])","function getERC20Permit(address) view returns (bool)","function requestTransferOwnership(address)","function cancelTransferOwnership()","function acceptTransferOwnership()","function rejectTransferOwnership()"]),P=["pause","unpause","updateAdminFee","updateMaximumLoanDuration","setERC20Permit","setERC20Permits","requestTransferOwnership","cancelTransferOwnership","acceptTransferOwnership","rejectTransferOwnership"];function m(u){return T(u,"Provide an explicit checksummed address.",k)}var S=u=>{let h=(n,i,c,e)=>({name:n,inputSchema:{type:"object",properties:i,required:c,additionalProperties:!1},execute:async(s,t)=>{try{if(v(t),Object.keys(s).some(a=>!Object.hasOwn(i,a)))throw new r("Unsupported Longbow administration argument.");return await e(s,t)}catch(a){throw new r(u.plainError(a))}}});async function b(){let n=u.clientFor(p);if(await n.getChainId()!==p)throw new r("Longbow requires chain 4663.");return n}return{tools:[h("longbow_nft_admin",{token:{type:"string"}},[],async n=>{let i=await b(),c=["owner","paused","maximumLoanDuration","adminFeeInBasisPoints"],e=await Promise.all(c.map(s=>i.readContract({address:d,abi:w,functionName:s})));return{chainId:p,contract:d,...Object.fromEntries(c.map((s,t)=>[s,typeof e[t]=="bigint"?String(e[t]):e[t]])),...n.token===void 0?{}:{token:m(n.token),permitted:await i.readContract({address:d,abi:w,functionName:"getERC20Permit",args:[m(n.token)]})}}}),h("longbow_manage_nft",{operation:{type:"string",enum:P},value:A(),account:{type:"string"},enabled:{type:"boolean"},tokens:{type:"array",maxItems:32,items:{type:"string"}},permissions:{type:"array",maxItems:32,items:{type:"boolean"}}},["operation"],async(n,i)=>{if(typeof n.operation!="string"||!P.includes(n.operation))throw new r("Choose a documented NFT administration operation.");let c=await b(),e=n.operation,s=e.startsWith("update")?["operation","value"]:e==="setERC20Permit"?["operation","account","enabled"]:e==="setERC20Permits"?["operation","tokens","permissions"]:e==="requestTransferOwnership"?["operation","account"]:["operation"];if(Object.keys(n).some(o=>!s.includes(o)))throw new r("Unexpected fields for this NFT administration operation.");if(!["acceptTransferOwnership","rejectTransferOwnership"].includes(e)){let o=await c.readContract({address:d,abi:w,functionName:"owner"});if(l(o)!==l(i))throw new r("This wallet lacks the NFT loan owner role.")}let t=[];if(e.startsWith("update")){let o=O(n.value,!0);if(o>(e==="updateAdminFee"?10000n:(1n<<32n)-1n))throw new r("NFT fee/duration exceeds the contract limit.");t=[e==="updateAdminFee"?Number(o):o]}else if(e==="setERC20Permit"){if(typeof n.enabled!="boolean")throw new r("Provide enabled as a boolean.");t=[m(n.account),n.enabled]}else if(e==="setERC20Permits"){if(!Array.isArray(n.tokens)||!Array.isArray(n.permissions)||!n.tokens.length||n.tokens.length>32||n.tokens.length!==n.permissions.length||n.permissions.some(f=>typeof f!="boolean"))throw new r("Provide equal bounded token and permission arrays.");let o=n.tokens.map(m);if(new Set(o).size!==o.length)throw new r("Currency tokens must be unique.");t=[o,n.permissions]}else if(e==="requestTransferOwnership"){let o=m(n.account);if(o===N)throw new r("New owner must be nonzero.");t=[o]}let a=`Longbow NFT protocol administration ${e} on ${d}, values ${JSON.stringify(t,(o,f)=>typeof f=="bigint"?String(f):f)}. This changes protocol-wide settings or authority. Ownership acceptance/rejection requires the pending owner; the contract preview verifies that role. Permitting a currency here does not qualify it for Oak\u2019s borrower tools.`,y=[u.unsignedTx({to:d,data:C({abi:w,functionName:e,args:t}),value:"0",chainId:p,description:a})];return{txs:y,preview:await u.preview(y,i),summary:a}}),h("longbow_referral",{},[],async(n,i)=>{let c=await u.http(`https://longbow.credit/api/referral/stats/${l(i)}`,{method:"GET",redirect:"error"});if(!c.ok)throw new r(`Longbow referral service returned HTTP ${c.status}; referral state is unavailable.`);let e=await c.json();if(!e||typeof e!="object"||m(e.address)!==l(i))throw new r("Referral response does not match this wallet.");let s=a=>{if(typeof a!="number"||!Number.isSafeInteger(a)||a<0)throw new r("Invalid referral count.");return a},t=e.bonusEarnedAllTime;if(typeof t!="number"||!Number.isFinite(t)||t<0)throw new r("Invalid referral bonus estimate.");if(e.code!==null&&e.code!==void 0&&(typeof e.code!="string"||!/^[a-zA-Z0-9_-]{1,64}$/.test(e.code)))throw new r("Invalid referral code.");return{address:l(i),chainId:p,code:e.code??null,referrals:s(e.referrals),activeThisEpoch:s(e.activeThisEpoch),bonusEstimateUsd:t,source:"Longbow public referral service; off-chain estimates, not verified payments.",warning:g("Referral links are permanent according to the app. Registration/linking publishes wallet associations and requires a separate authorized publication flow. This tool only reads stats; no payout or claim is promised.")}})]}};export{w as a,S as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as qe,s as oe,x as xe}from"./YOENHHKI.js";import{a as Be}from"./NRBIXV7V.js";import{a as y}from"./WWNAGOCD.js";import{a as w,b as re,d as ve,e as A,f as d,h as $,i as q,j as k,k as N,l as H,m as R,n as ie,o as f,p as c,q as I,r as j,s as He,t as Se}from"./5OEHZJ6X.js";import{b as K,f as Pe,g as V,h as Te,i as Le}from"./ACN2BFMA.js";import{i as ne}from"./FUXT7GRK.js";import{a as be}from"./CY75R4FK.js";import{s as ge}from"./G6HCV67X.js";import{a as o}from"./5YS5V2LK.js";import{encodeAbiParameters as _e,encodeFunctionData as Qe,erc20Abi as We,formatUnits as Ae,getAddress as ue,parseAbi as _,zeroAddress as b,zeroHash as se}from"viem";var Ge="hookr_launch",g=ue(K.launcherV1),z=ue(K.rulesV1),Je=[{type:"tuple",components:[{name:"flags",type:"uint16"},{name:"minScore",type:"uint32"},{name:"tierScore",type:"uint32"},{name:"tierPips",type:"uint24"},{name:"reviewers",type:"bytes32"}]}],X=(a,n=Object.keys(a))=>({type:"object",properties:a,required:n,additionalProperties:!1}),Re={type:"string",pattern:"^0x[0-9a-fA-F]{40}$"},ae=X({token:{oneOf:[X({kind:{const:"new",type:"string"},name:{type:"string",minLength:1,maxLength:48},symbol:{type:"string",minLength:1,maxLength:12},supply:w,salt:re}),X({kind:{const:"existing",type:"string"},address:Re})]},quote:{...Re,description:"Qualified ETH (zero address) or pinned USDG quote. Other quote funding routes await qualification."},sqrtPriceX96:{...w,description:"Integer sqrt(currency1/currency0) times 2^96 for the sorted PoolKey."},tickLower:{type:"integer",minimum:-887272,maximum:887272},tickUpper:{type:"integer",minimum:-887272,maximum:887272},liquidity:w,amount0Max:w,amount1Max:w,agentGate:X({minScore:w,tierScore:w,tierPips:w,reviewerSetId:re}),lpRewardsBps:w,arbRecapture:{type:"boolean"},deadline:w});function Ye(a){let n=A(a,Object.keys(ae.properties),ae.required),r=R(n.token);if(r.kind==="existing")throw A(r,["kind","address"],["kind","address"]),q(r.address),new o("Existing-token Hookr launches await a qualified funding route. Use token.kind new.");if(A(r,["kind","name","symbol","supply","salt"],["kind","name","symbol","supply","salt"]),r.kind!=="new")throw new o("Choose token.kind new; existing tokens are not supported yet.");let e=(P,M)=>{if(typeof P!="string"||!P.trim()||new TextEncoder().encode(P).length>M||[...P].some(Q=>Q.codePointAt(0)<32)||/[\u007f-\u009f\u2028-\u202e\u2066-\u2069\ud800-\udfff]/u.test(P))throw new o(`Use nonempty public token text within ${M} UTF-8 bytes without control characters.`);return P},i=d(r.supply,108);if(!i)throw new o("Hookr new-token supply must be positive and at most 2^108-1 base units.");let t=q(n.quote);if(![b,ue(ge.mainnet.usdg)].includes(t))throw new o("Use native ETH (zero address) or the pinned USDG quote; other quote funding routes await qualification.");let l=n.tickLower,u=n.tickUpper;if(typeof l!="number"||typeof u!="number")throw new o("Provide integer aligned Hookr ticks.");xe(l,u,y.tickSpacing);let s=d(n.sqrtPriceX96,160);if(s<=ne(l)||s>=ne(u))throw new o("Hookr opening price must be strictly inside the aligned tick range.");let p=d(n.liquidity,127);if(!p)throw new o("Hookr liquidity must be positive and at most int128 max.");let m=d(n.amount0Max,128),L=d(n.amount1Max,128),x=qe({liquidity:p,tickLower:l,tickUpper:u,sqrtPriceX96:s,roundUp:!0});if(x.amount0>=1n<<127n||x.amount1>=1n<<127n||!x.amount0||!x.amount1||x.amount0>m||x.amount1>L)throw new o("Hookr exact rounded-up debts must be positive and fit both approved funding caps. Reduce liquidity or increase the caps.");let h=A(n.agentGate,["minScore","tierScore","tierPips","reviewerSetId"],["minScore","tierScore","tierPips","reviewerSetId"]),F=Number(d(h.minScore,32)),S=Number(d(h.tierScore,32)),B=Number(d(h.tierPips,24)),O=$(h.reviewerSetId);if(B>5e4||S===0!=(B===0)||(F!==0||S!==0)!=(O!==se))throw new o("Use tierPips at most 50000, paired nonzero tier score/pips, and a registered reviewer set only for scored gates. Identity-only uses all zero values.");let U=Number(d(n.lpRewardsBps,16));if(U>1e3)throw new o("Hookr LP Rewards plus burn must not exceed 1000 bps; this profile has zero burn.");if(typeof n.arbRecapture!="boolean")throw new o("Choose arbRecapture true or false explicitly.");return{token:{existing:b,name:e(r.name,48),symbol:e(r.symbol,12),supply:i,salt:$(r.salt)},quote:t,sqrtPriceX96:s,tickLower:l,tickUpper:u,liquidity:p,amount0Max:m,amount1Max:L,debts:x,gateTerms:{flags:1,minScore:F,tierScore:S,tierPips:B,reviewers:O},lpRewardsBps:U,arbRecapture:n.arbRecapture,deadline:d(n.deadline,64)}}async function Ze(a,n,r,e){return q(await c(a,g,f("launcherV1"),"predictToken",[n,r],e))}async function et(a,n,r,e,i){let t=r.gate;if(!t.walletAgent||!(e?t.healthyForScores:t.healthyIdentityOnly))throw new o("Hookr needs a healthy on-chain agent identity. Own an ERC-8004 identity or link its current agent wallet on the Hookr gate; Oak setup linking alone is insufficient.");let l=(p,m)=>c(a,t.identity,_(["function balanceOf(address) view returns (uint256)","function ownerOf(uint256) view returns (address)","function getAgentWallet(uint256) view returns (address)"]),p,m,i),u=k(await l("balanceOf",[n])),s=!1;if(t.link.linked){let p=BigInt(t.link.agentId);s=q(await l("getAgentWallet",[p]))===n,!s&&u>0n&&(s=q(await l("ownerOf",[p]))===n)}if(!u&&!s||e&&!s)throw new o("Hookr on-chain identity ownership or gate link is missing or stale. Link a current ERC-8004 agent ID on the Hookr gate before launching; scored gates require that link even for an NFT owner.")}async function tt(a,n,r){let e=Ye(n);if(a.network==="testnet")throw new o("Hookr launch requires Robinhood Chain 4663.");let i=a.clientFor(4663),t=await Te(i);if(e.deadline<=t.timestamp||e.deadline>t.timestamp+y.deadlineSeconds)throw new o("Set a fresh Hookr deadline within the next 300 seconds of chain time.");let l=e.gateTerms.reviewers!==se,u=await Be(i,r,t.number,l?[e.gateTerms.reviewers]:[]);if(!u.rootOpenForWallet||u.newMarketsPaused||!u.launcherAdmitted)throw new o("Hookr new markets or the reviewed Launcher are closed. Retry only after registry admission is restored.");await et(i,r,u,l,t.number);let s=await Ze(i,r,e.token,t.number);if(s===b||s===e.quote)throw new o("Hookr predicted token collides with its quote. Choose a fresh salt.");let p={currency0:BigInt(s)<BigInt(e.quote)?s:e.quote,currency1:BigInt(s)<BigInt(e.quote)?e.quote:s,fee:8388608,tickSpacing:y.tickSpacing,hooks:I},m=oe(p),L=p.currency0===s,x=L?e.amount0Max:e.amount1Max,h=L?e.amount1Max:e.amount0Max,F=L?e.debts.amount0:e.debts.amount1,S=L?e.debts.amount1:e.debts.amount0;if(x>e.token.supply)throw new o("Hookr new-token deposit cap exceeds its fixed supply.");let[B,O,U,P,M,Q,Ie,Fe]=await Promise.all([i.getCode({address:s,blockNumber:t.number}),i.getTransactionCount({address:s,blockNumber:t.number}),c(i,g,f("launcherV1"),"memberKey",[s,e.quote,y.tickSpacing,I],t.number),c(i,I,f("rootV1"),"knownPool",[m],t.number),c(i,g,f("launcherV1"),"SKIP_TAKEN",[],t.number),c(i,j,f("registry"),"isQuote",[e.quote],t.number),c(i,j,f("registry"),"quoteIsBraked",[e.quote],t.number),c(i,z,f("rulesV1"),"minProtocolShareBps",[],t.number)]),[Ce,$e]=H(U,2);if(e.token.salt===$(M))throw new o("SKIP_TAKEN is unsupported. Choose an ordinary new-token salt.");if(B&&B!=="0x"||O!==0||N(P)||!N($e)||oe(R(Ce))!==m)throw new o("Hookr token address or pool is already taken or its predicted key differs. Choose a fresh salt and rebuild.");if(!N(Q)||N(H(Ie,2)[0]))throw new o("The Hookr quote is not currently qualified or is braked. Choose an admitted quote.");let ce=R(u.gate.admission),Ne=R(ce.caps),pe=d(Ne.maxLpFeePips,24),Oe=BigInt(u.coreAdmission.caps.maxLpFeePips),W=BigInt(y.baseLpFeePips)+pe;if(BigInt(e.gateTerms.tierPips)>pe||W>Oe||W>600000n)throw new o("Hookr gate tier or total LP fee exceeds the live admission cap. Lower the tier or wait for compatible admission.");let de=q(await c(i,z,f("rulesV1"),"protocolRecipient",[],t.number));await V(i,t.number,[de]);let[Ue,Me,Ee]=H(await c(i,de,_(["function feeTerms(address,bool,bytes32) view returns (uint16,uint16,uint16)"]),"feeTerms",[b,e.arbRecapture,m],t.number),3),le=k(Ue,16),G=k(Ee,16);if(k(Me,16)!==0n||G>10000n)throw new o("Hookr treasury minimum or integrator terms exceed the reviewed profile.");let me=k(Fe,16),E=le>me?le:me;if(E<2000n||E>5000n)throw new o("Hookr protocol share is outside the reviewed 2000\u20135000 bps profile.");let J=BigInt(e.lpRewardsBps)*100n+(!e.arbRecapture&&e.lpRewardsBps===0?G:0n);if(J>BigInt(u.coreAdmission.caps.maxQuoteTakePips))throw new o("Hookr LP Rewards and minimum quote charge exceed the live quote-take cap. Lower LP Rewards.");let Y={on:e.arbRecapture,traderBps:0,lpBps:e.arbRecapture?1e4:0,period:0,maxPrizeBps:0,potReleaseBps:0,minBuyQuote:0n,releaseBlocks:0},he=null;if(e.arbRecapture){let[D,ye]=await Promise.all([c(i,z,_(["function recaptureDefaults() view returns ((bool on,uint16 traderBps,uint16 lpBps,uint32 period,uint16 maxPrizeBps,uint16 potReleaseBps,uint128 minBuyQuote,uint32 releaseBlocks) rc,uint16 potBps)"]),"recaptureDefaults",[],t.number),c(i,j,f("registry"),"activeLaneOf",[I],t.number)]);Y.releaseBlocks=Number(k(R(H(D,2)[0]).releaseBlocks,32));let[Ve,je,ze,Xe]=H(ye,4),te=q(Ve);if(await V(i,t.number,[te]),te===b||$(je)!==Pe(te).codeHash||k(ze,32)===0n||k(Xe,16)>10000n||!Y.releaseBlocks)throw new o("Hookr recapture lane is unavailable. Use arbRecapture false until its executor and gas floor are reviewed.");he=ie(ye)}let we={quote:e.quote,tickSpacing:y.tickSpacing,sqrtPriceX96:e.sqrtPriceX96,tickLower:e.tickLower,tickUpper:e.tickUpper,liquidity:e.liquidity,amount0Max:e.amount0Max,amount1Max:e.amount1Max,config:{subject:s,quote:e.quote,rules:z,advisory:Se,liquidityOwner:g,baseLpFeePips:y.baseLpFeePips,caps:{maxLpFeePips:Number(W),maxQuoteTakePips:Number(J),maxSubjectTakeBps:0},rulesGasLimit:Number(u.coreAdmission.gasLimit),advisoryGasLimit:Number(d(ce.gasLimit,32)),advisoryPhases:1,advisoryFailOpen:!1,policyId:se},rules:{guardEndBlock:0,maxFeePips:y.baseLpFeePips,snipeTaxPips:0,snipeFloorPips:0,snipeDecaySeconds:0,dynamicFeeSens:0,burnBps:0,lpBps:e.lpRewardsBps,potBps:0,royaltyBps:0,protocolShareBps:Number(E),potEveryNBuys:0,maxBuyQuoteAmount:0n,potMinBuyQuote:0n,royaltyTo:b,integrator:b},recapture:Y},v=BigInt(u.launchFee.amount);if(v>10000000000000000n)throw new o("Hookr launch fee exceeds the reviewed 0.01 ETH maximum.");let T=b;if(v&&(await V(i,t.number,[u.launchFee.treasury]),T=q(await c(i,u.launchFee.treasury,_(["function target() view returns (address)"]),"target",[],t.number)),T===b||T===g||T===r||T===He))throw new o("Hookr launch fee recipient is outside the reviewed payment profile.");let Z=v+(e.quote===b?h:0n),ee=[],C=[];if(e.quote!==b){let D=k(await c(i,e.quote,We,"allowance",[r,g],t.number));D!==0n&&D!==h&&C.push(a.approval(e.quote,g,"0",4663)),C.push(a.approval(e.quote,g,h.toString(),4663)),ee.push({token:e.quote,amount:h})}Z&&ee.push({token:be,amount:Z,to:g});let ke=`Launch public, permanent token ${JSON.stringify(e.token.name)} (${JSON.stringify(e.token.symbol)}), fixed supply ${Ae(e.token.supply,18)} (18 decimals). Create one agents-only pool (identity check on every buy). Price currency1/currency0 = ${e.sqrtPriceX96*e.sqrtPriceX96}/${1n<<192n}; sqrtPriceX96 ${e.sqrtPriceX96}, ticks ${e.tickLower} to ${e.tickUpper}, spacing ${y.tickSpacing}. Deposit at most ${e.amount0Max} currency0 and ${e.amount1Max} currency1 base units; exact launch debts ${e.debts.amount0} and ${e.debts.amount1}. Currency0 ${p.currency0}; currency1 ${p.currency1}. Launch fee ${v} wei to ${T} (${Ae(v,18)} ETH). Unused quote funding (${h-S} base units) and retained token supply (${e.token.supply-F} base units) return to ${r} in this transaction. Family owner ${r}; token ${s}; pool ${m}. LP base fee 3000 pips; gate flags 1, scores ${e.gateTerms.minScore}/${e.gateTerms.tierScore}, tier ${e.gateTerms.tierPips} pips; LP Rewards ${e.lpRewardsBps} bps; burn 0; quote-take cap ${J} pips (includes Hookr minimum); protocol share ${E} bps. Arb recapture ${e.arbRecapture}; deadline ${e.deadline}. No lock.`;C.push(a.unsignedTx({to:g,data:Qe({abi:f("launcherV1"),functionName:"launchAdvised",args:[e.token,I,[we],[_e(Je,[e.gateTerms])],e.deadline]}),value:Z.toString(),chainId:4663,description:ke}));let[fe,De,Ke]=await Promise.all([i.getCode({address:s}),i.getTransactionCount({address:s}),i.readContract({address:g,abi:ve,functionName:"launchFee"})]);if(fe&&fe!=="0x"||De!==0||k(H(Ke,5)[0])!==v)throw new o("Hookr collision state or launch fee changed. Request a fresh launch preview.");return await Le(i,t),{txs:C,inputs:ee,summary:ke,tokenAddress:s,poolId:m,feeTarget:T,feeTreasury:u.launchFee.treasury,terms:ie({request:n,blockNumber:t.number,blockHash:t.hash,owner:r,tokenAddress:s,poolId:m,poolKey:p,member:we,gateTerms:e.gateTerms,launchFee:v,feeTarget:T,feeTreasury:u.launchFee.treasury,hookrMinimumPips:G,exactApprovals:C.slice(0,-1),refunds:{quote:h-S,retainedSupply:e.token.supply-F},gasEstimate:null,gasEstimateReason:"The local sender estimates the ordered exact calls after funding approvals and confirms the gas limit and maximum fee.",lane:he,pins:K})}}function nt(a){if(!Array.isArray(a)||a.length<1||a.length>3)throw new o("Hookr launch requires only the locally reconstructed finite approvals and one launch transaction.");for(let n of a)A(n,["to","data","value","chainId","description"],["to","data","value","chainId","description"])}function mt(a,n){if(nt(a),a.length!==n.length||a.some((r,e)=>r.to.toLowerCase()!==n[e].to.toLowerCase()||r.data.toLowerCase()!==n[e].data.toLowerCase()||r.value!==n[e].value||r.chainId!==4663))throw new o("Hookr launch differs from the locally reconstructed exact parameters, approvals and funding.")}function ht(a){return[{name:Ge,inputSchema:ae,execute:async(n,r)=>{let e=await tt(a,n,r);return{txs:e.txs,preview:await a.preview(e.txs,r),terms:e.terms,summary:e.summary}}}]}export{Ge as a,g as b,z as c,ae as d,Ye as e,tt as f,nt as g,mt as h,ht as i};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function c(r,t){return r==="hoodlock_airdrop_claim"&&!Object.hasOwn(t,"id")}var h=new Map([]),_="find_tool",l="run_tool",n=["oak_setup","oak_identity_unlink","oak_subscribe","oak_renew","send","hoodlock_feature_buy","hoodlock_feature_claim","hoodlock_referral_register"],d={oak:["account","balances","find_token","price","quote","swap","positions","send","oak_setup","oak_subscribe","oak_renew","oak_identity_unlink"],kyberswap:[],velora:[],steakhouse:["steakhouse_deposit","steakhouse_withdraw"],spark:["spark_deposit","spark_withdraw"],netnet:["netnet_deposit","netnet_withdraw"],longbow:["longbow_list","longbow_deposit","longbow_withdraw"],grove:["grove_deposit","grove_withdraw"],beefy:["beefy_list","beefy_deposit","beefy_withdraw"],pons:["pons_browse","pons_buy","pons_sell","pons_launch"],orbio:["orbio_credit_status","orbio_buy_credit"],hoodlock:["hoodlock_list_locks","hoodlock_lock","hoodlock_withdraw"],merkl:["merkl_rewards","merkl_claim"],relay:["relay_bridge_in","relay_bridge_out","relay_status"],lighter:["lighter_funding"],erc8004:["erc8004_identity"],hoodag:["hoodag_resolve","hoodag_register"],heyresearch:["heyresearch_research_project"],priors:["priors_status","priors_lend","priors_withdraw","priors_borrow","priors_repay"],morpho:["morpho_status","morpho_supply","morpho_withdraw","morpho_supply_collateral","morpho_withdraw_collateral","morpho_borrow","morpho_repay"],uniswap:["uniswap_list_positions","uniswap_add","uniswap_remove","uniswap_collect"],hookr:["hookr_orders","hookr_create","hookr_cancel"],meridian:["meridian_browse","meridian_positions","meridian_sell","meridian_redeem"],tickerspring:["tickerspring_account","tickerspring_create","tickerspring_cancel","tickerspring_claim"],clanker:["clanker_browse","clanker_launch"],poolstrade:["poolstrade_status","poolstrade_buy","poolstrade_sell","poolstrade_launch"]};function w(r,t){let i=new Set(r),s=new Set;for(let[e,a]of Object.entries(d))for(let o of a){if(s.has(o))throw new Error(`Visible tool ${o} is listed twice.`);if(e!=="oak"&&!o.startsWith(`${e}_`))throw new Error(`Visible tool ${o} is filed under ${e}.`);if(n.includes(o)||i.has(o))s.add(o);else if(t==="mainnet")throw new Error(`Visible tool ${o} is not registered.`)}for(let e of[_,l,...n])if(i.has(e))throw new Error(`Tool name ${e} is reserved for the add-on.`);return s}export{c as a,h as b,_ as c,l as d,n as e,d as f,w as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as J,e as Y}from"./TDN3C4IG.js";import{d as U,e as D,v as _}from"./JG24LNUI.js";import{a as R,b as Q,c as H,d as L,e as $,f as G,g as W}from"./IAXKPME3.js";import{a as E}from"./EG6M6SSO.js";import{a as S}from"./UWOFA6GV.js";import{c as l,g as B}from"./73N3TOJL.js";import{a as g,i as N}from"./XPFVT2EA.js";import{a as o}from"./5YS5V2LK.js";import{encodeAbiParameters as x,encodeFunctionData as Z,encodePacked as pe,getAddress as ie,parseAbi as V,parseAbiParameters as A,zeroAddress as w}from"viem";var ee=ie("0x33e885ed0ec9bf04ecfb19341582aadcb4c8a9e7"),te=ie(N[4663].ponsTrade.quoter.address),de=V(["function execute(bytes commands,bytes[] inputs,uint256 deadline) payable"]),me=V(["function approve(address token,address spender,uint160 amount,uint48 expiration)"]),ne=V(["function factory() view returns (address)","function quoteExactInput(bytes path,uint256 amountIn) returns (uint256,uint160[],uint32[],uint256)","function quoteExactOutput(bytes path,uint256 amountOut) returns (uint256,uint160[],uint32[],uint256)"]),M="(address intermediateCurrency,uint24 fee,int24 tickSpacing,address hooks,bytes hookData)",z="(address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks)",oe=V([`function quoteExactInput((address exactCurrency,${M}[] path,uint128 exactAmount) params) returns (uint256,uint256)`,`function quoteExactOutput((address exactCurrency,${M}[] path,uint128 exactAmount) params) returns (uint256,uint256)`,`function quoteExactInputSingle((${z} poolKey,bool zeroForOne,uint128 exactAmount,bytes hookData) params) returns (uint256,uint256)`,`function quoteExactOutputSingle((${z} poolKey,bool zeroForOne,uint128 exactAmount,bytes hookData) params) returns (uint256,uint256)`]),fe=A(`(address exactCurrency,${M}[] path,uint256[] minHopPriceX36,uint128 amount,uint128 limit)`);function ye(u,t,i,d){let a=[],e=d?i:t,r=new Set([e]);for(let n of d?[...u].reverse():u){let s=n.currency0===e?n.currency1:n.currency1===e?n.currency0:void 0;if(!s||r.has(s))throw new o("V4 poolKeys must form a continuous route without repeated currencies.");a.push({intermediateCurrency:s,fee:n.fee,tickSpacing:n.tickSpacing,hooks:n.hooks,hookData:"0x"}),e=s,r.add(e)}if(e!==(d?t:i))throw new o("V4 route does not end at the requested currency.");return a}var le=A(`(${z} poolKey,bool zeroForOne,uint128 amount,uint128 limit,uint256 minHopPriceX36,bytes hookData)`),he=A("address recipient,uint256 amount,uint256 limit,bytes path,bool payerIsUser,uint256[] minHopPriceX36"),xe=A("address recipient,uint256 amount,uint256 limit,address[] path,bool payerIsUser,uint256[] minHopPriceX36"),re=A("address,uint256"),be=A("bytes,bytes[]");function we(u,t,i){let d=i?[...u].reverse():u,a=i?[...t].reverse():t,e=d[0];return a.forEach((r,n)=>{e=`${e}${pe(["uint24","address"],[r,d[n+1]]).slice(2)}`}),e}var ue={version:{type:"string",enum:["v2","v3","v4"]},tokenIn:l,tokenOut:l,path:{type:"array",minItems:2,maxItems:6,items:l},fees:{type:"array",items:{type:"integer",minimum:0,maximum:1e6}},poolKeys:{type:"array",minItems:1,maxItems:5,items:{type:"object",required:["currency0","currency1","fee","tickSpacing","hooks"],properties:{currency0:l,currency1:l,fee:{type:"integer"},tickSpacing:{type:"integer"},hooks:l},additionalProperties:!1}},poolKey:{type:"object",properties:{currency0:l,currency1:l,fee:{type:"integer"},tickSpacing:{type:"integer"},hooks:l},required:["currency0","currency1","fee","tickSpacing","hooks"],additionalProperties:!1},amountIn:S(),amountOut:S(),minAmountOut:S(),maxAmountIn:S(),slippageBps:{type:"integer",minimum:0,maximum:9999}};async function Ae(u,t,i,d=!1){W(t,Object.keys(ue));let a=t.version;if(!["v2","v3","v4"].includes(String(a)))throw new o("Provide version v2, v3 or v4.");let e=t.amountOut!==void 0;if(t.amountIn!==void 0===e)throw new o("Provide exactly one of amountIn or amountOut.");if(e&&t.minAmountOut!==void 0||!e&&t.maxAmountIn!==void 0)throw new o("Use maxAmountIn for exact output, minAmountOut for exact input.");let r=R(e?t.amountOut:t.amountIn,e?"amountOut":"amountIn",a==="v4"?128:160),n=H(t.tokenIn),s=H(t.tokenOut);if(n===s)throw new o("Swap requires different input and output currencies.");let v=u.clientFor(g),y=await v.getBlock(),F=L(t.slippageBps),I,m,q,k,h,c,C;if(a==="v4"){if(t.path!==void 0||t.fees!==void 0)throw new o("V4 uses poolKey or poolKeys; omit path and fees.");if(t.poolKey===void 0==(t.poolKeys===void 0))throw new o("Provide poolKey or poolKeys, not both.");if(t.poolKeys!==void 0){if(!Array.isArray(t.poolKeys)||t.poolKeys.length<1||t.poolKeys.length>5)throw new o("Provide 1 to 5 v4 poolKeys.");let p=t.poolKeys.map(P=>_(P));I=ye(p,n,s,e),m=(await v.simulateContract({address:te,abi:oe,functionName:e?"quoteExactOutput":"quoteExactInput",args:[{exactCurrency:e?s:n,path:I,exactAmount:r}],account:i,gas:E,blockNumber:y.number})).result[0]}else{if(h=_(t.poolKey),![h.currency0,h.currency1].includes(n)||![h.currency0,h.currency1].includes(s))throw new o("PoolKey currencies differ from the requested swap.");m=(await v.simulateContract({address:te,abi:oe,functionName:e?"quoteExactOutputSingle":"quoteExactInputSingle",args:[{poolKey:h,zeroForOne:n===h.currency0,exactAmount:r,hookData:"0x"}],account:i,gas:E,blockNumber:y.number})).result[0]}k="0x10"}else{if(t.poolKey!==void 0||t.poolKeys!==void 0||n===w||s===w)throw new o("V2/v3 routes use ERC-20 tokens; wrap ETH to WETH first.");if(c=Array.isArray(t.path)?t.path.map(Q):[n,s],c.length<2||c.length>6||c[0]!==n||c.at(-1)!==s||new Set(c).size!==c.length||c.includes(w))throw new o("Path must contain 2 to 6 distinct ERC-20 tokens in input-to-output order.");if(a==="v2"){if(t.fees!==void 0)throw new o("V2 fees are fixed by the pair; omit fees.");let p=await v.readContract({address:J,abi:Y,functionName:e?"getAmountsIn":"getAmountsOut",args:[r,c],blockNumber:y.number});m=e?p[0]:p.at(-1),k=e?"0x09":"0x08"}else{let p=t.fees;if(!Array.isArray(p)||p.length!==c.length-1||p.some(P=>typeof P!="number"||!Number.isInteger(P)||P<0||P>1e6))throw new o("Provide one integer v3 fee in pips per path hop.");if(!B(await v.readContract({address:ee,abi:ne,functionName:"factory",blockNumber:y.number}),N[4663].uniswap.v3_factory.address))throw new o("V3 quoter is not configured for the pinned factory.");C=we(c,p,e),m=(await v.simulateContract({address:ee,abi:ne,functionName:e?"quoteExactOutput":"quoteExactInput",args:[C,r],account:i,gas:E,blockNumber:y.number})).result[0],k=e?"0x01":"0x00"}}if(m<=0n)throw new o("No positive Uniswap quote is available.");let T=e?t.maxAmountIn:t.minAmountOut;if(!d&&T===void 0)throw new o(`Provide ${e?"maxAmountIn":"minAmountOut"} from uniswap_quote to confirm the trade bound.`);let f=T===void 0?e?(m*BigInt(1e4+F)+9999n)/10000n:m*BigInt(1e4-F)/10000n:R(T,e?"maxAmountIn":"minAmountOut",a==="v4"?128:160);if(f<=0n||(e?f<m:f>m))throw new o("The fresh quote does not satisfy the confirmed swap bound.");let b=e?f:r;if(b>=1n<<160n||a==="v4"&&(b>=1n<<128n||f>=1n<<128n))throw new o("Swap bounds exceed the router amount range.");let[ae,se]=await Promise.all([$(u,n,y.number),$(u,s,y.number)]),j={version:a,input:{token:ae,amount:(e?m:r).toString()},output:{token:se,amount:(e?r:m).toString()},[e?"maxAmountIn":"minAmountOut"]:f.toString(),blockNumber:y.number.toString(),expiresAt:(y.timestamp+60n).toString()};if(d)return{quote:j,summary:"Read-only on-chain quote. Repeat the same route with the returned bound in uniswap_swap; execution gets a fresh quote and preview."};let O=y.timestamp+300n,K=[];if(n!==w&&(K.push(u.approval(n,U,b.toString(),g)),K.push(u.unsignedTx({to:U,data:Z({abi:me,functionName:"approve",args:[n,D,b,Number(O)]}),value:"0",chainId:g,description:`Permit exactly ${b} input base units to Universal Router until ${O}.`}))),a==="v4"){let p=I?x(fe,[{exactCurrency:e?s:n,path:I,minHopPriceX36:[],amount:r,limit:f}]):x(le,[{poolKey:h,zeroForOne:n===h.currency0,amount:r,limit:f,minHopPriceX36:0n,hookData:"0x"}]);q=x(be,[I?e?"0x090c0f":"0x070c0f":e?"0x080c0f":"0x060c0f",[p,x(re,[n,b]),x(re,[s,e?r:f])]])}else a==="v2"?q=x(xe,[i,r,f,c,!0,[]]):q=x(he,[i,r,f,C,!0,[]]);let X=[q];return n===w&&e&&(k=`${k}04`,X.push(x(A("address,address,uint256"),[w,i,0n]))),K.push(u.unsignedTx({to:D,data:Z({abi:de,functionName:"execute",args:[k,X,O]}),value:n===w?b.toString():"0",chainId:g,description:`Uniswap ${a} ${e?"exact output":"exact input"} swap; recipient ${i}; deadline ${O}.`})),{...await G(u,K,i,"Swap through Universal Router 2.1.2. Exact approvals, fixed output/input bound and five-minute on-chain deadline. Venue fees included; gas excluded."),quote:j}}function Ee(u){return{tools:[!0,!1].map(t=>({name:t?"uniswap_quote":"uniswap_swap",inputSchema:{type:"object",additionalProperties:!1,required:["version","tokenIn","tokenOut"],properties:ue},execute:(i,d)=>Ae(u,i,d,t)}))}}export{ee as a,te as b,de as c,me as d,ne as e,oe as f,fe as g,ye as h,le as i,he as j,xe as k,we as l,Ae as m,Ee as n};
|