@oakagentkit/core 0.2.0 → 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.d.ts +4 -0
- 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/{XKRWJCYE.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/{64AF7ECA.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/{ITV52TIE.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/{O5SU2I3G.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/{3ACEWCKZ.js → 6ZYLNB2B.js} +1 -1
- package/build/dist/chunks/7XLEYOZH.js +1 -0
- package/build/dist/chunks/{QCD33HMD.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/{5FTSKYQH.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/{NO57NGRV.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/{WDGPCPQJ.js → EXRKBBX2.js} +1 -1
- package/build/dist/chunks/{U3FMCX3L.js → FBSUTF3B.js} +1 -1
- package/build/dist/chunks/FUXT7GRK.js +1 -0
- 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/{ZYR5LSVB.js → GJY3P6OG.js} +1 -1
- package/build/dist/chunks/HOEQVPY7.js +1 -0
- package/build/dist/chunks/{R7D256HG.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/JPOYTTTW.js +1 -0
- package/build/dist/chunks/{4IPW5WZ4.js → JST5JGAP.js} +1 -1
- package/build/dist/chunks/{ZCGVBK5K.js → JVI26KQO.js} +1 -1
- package/build/dist/chunks/JWCOXLYA.js +1 -0
- package/build/dist/chunks/{G7UKNO2I.js → KHJFXJBU.js} +1 -1
- package/build/dist/chunks/{HQVC6X3T.js → KSZMMNXK.js} +1 -1
- package/build/dist/chunks/{JC4SYMBV.js → L3ZM77SJ.js} +1 -1
- package/build/dist/chunks/{QRUC7EFE.js → L62M7LOB.js} +1 -1
- package/build/dist/chunks/{5VXNQFYJ.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/{BXN3MDS4.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/NMYGNJIJ.js +1 -0
- 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/{SDICP7BT.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/{KQFDLDHL.js → PWBL4WKB.js} +1 -1
- package/build/dist/chunks/{55NX776C.js → PZHR4ITH.js} +1 -1
- package/build/dist/chunks/{ANQ43XJA.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/{7BTELNNI.js → R53P2K3C.js} +1 -1
- package/build/dist/chunks/{5HW6JKME.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/{GHDDVBPK.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/{BFVLBENV.js → SQZRVIVF.js} +1 -1
- package/build/dist/chunks/{N6RL3SUZ.js → SSTROLQM.js} +1 -1
- package/build/dist/chunks/{IUXOUKQN.js → SXAIXD56.js} +1 -1
- package/build/dist/chunks/{TNRDCBGO.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/{HRG2VVPY.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/{SQH7A4O3.js → TWCSCRFS.js} +1 -1
- package/build/dist/chunks/{2EDXKJ3B.js → TWSTOFN3.js} +1 -1
- package/build/dist/chunks/{JREVERSC.js → U3F6DDML.js} +1 -1
- package/build/dist/chunks/{6PU2CMQZ.js → UFS2RVEZ.js} +1 -1
- package/build/dist/chunks/{Y2IWPNEW.js → UNZRE3YU.js} +1 -1
- package/build/dist/chunks/{K463HFGC.js → USSOVTD5.js} +1 -1
- package/build/dist/chunks/V2OOOV6B.js +1 -0
- package/build/dist/chunks/{WQZLYX64.js → V5LTA42G.js} +1 -1
- package/build/dist/chunks/{TAI63P6E.js → VC2RCYQE.js} +1 -1
- package/build/dist/chunks/{2SNQWKHA.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/{FSPNOVKB.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/{PJ65ZOQ7.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/{QZTUMSQY.js → Y2KH6DCE.js} +1 -1
- package/build/dist/chunks/{GSI5COTD.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/{A25P24G2.js → YZSTP2E6.js} +1 -1
- package/build/dist/chunks/{T3NPRRTY.js → Z7RL4NGX.js} +1 -1
- package/build/dist/chunks/{LI7FYINH.js → ZT47KN7A.js} +1 -1
- package/build/dist/chunks/{QQWF6A4P.js → ZUG6MG46.js} +1 -1
- package/package.json +2 -2
- package/build/dist/chunks/46ZA2R5L.js +0 -1
- package/build/dist/chunks/6SCCW74G.js +0 -1
- package/build/dist/chunks/74BPMUAG.js +0 -1
- package/build/dist/chunks/7Z5IM2QZ.js +0 -1
- package/build/dist/chunks/DLIOZCEG.js +0 -1
- package/build/dist/chunks/EYYUWFUR.js +0 -1
- package/build/dist/chunks/G4PDM3MX.js +0 -1
- package/build/dist/chunks/JRO6WTK4.js +0 -1
- package/build/dist/chunks/NBRMUFJP.js +0 -1
- package/build/dist/chunks/NIOBE2LK.js +0 -1
- package/build/dist/chunks/OJMYESQU.js +0 -1
- package/build/dist/chunks/UMK564HS.js +0 -1
- package/build/dist/chunks/XPFVT2EA.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as G}from"./NBRMUFJP.js";import{b as j,c as V,d as W}from"./46ZA2R5L.js";import{d as ae,e as L}from"./CAU44UWP.js";import{a as N}from"./VJ3W2V3B.js";import{a as v}from"./6IM6A5VA.js";import{a as R,b as ie,c as se,d as U}from"./RETS2ZEK.js";import{a as S,i as x}from"./XPFVT2EA.js";import{a as o}from"./5YS5V2LK.js";import{decodeEventLog as He,encodeAbiParameters as fe,encodeFunctionData as ye,erc20Abi as Q,getAddress as l,isAddress as $,keccak256 as $e,parseAbi as Ee,parseAbiParameters as pe,toEventSelector as we}from"viem";var A=l(x[4663].hookr.HookrLimitOrders.address),_e=l(x[4663].hookr.HookrRoot.address),ve=l(x[4663].hookr.HookrRouter.address),kt=l(x[4663].hookr.HookrRegistry.address),Ne=l(x[4663].hookr.HookrForwarder.address),Be=l(x[4663].hookr.PoolManager.address),Ot=l(x[4663].hookr.HOOKR_Token.address),Fe=l("0x000000000000000000000000000000000000dEaD"),Me=8388608,ze=200,de=60n,qe=604800n,ce=31536000n,It=10,At=100,ht="500000000000000",St="10000000000000000",ue=4096n,Y=32n,Xe=1e4,Ke=(1n<<127n)-1n,me=(1n<<128n)-1n,Ue=(1n<<160n)-1n,je=(1n<<40n)-1n,Ve=16777215,We=8388607,le=1n<<192n,J=0,F=1,Ge=2,Ye=3,Qe=we("OrderCreated(uint256,address,bytes32,bool,uint128,uint128,uint128,uint40,address)"),Ct=we("OrderCancelled(uint256,address,address,uint256,uint256)"),D=Ee(["function bountyBounds((address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks) key, bool zeroForOne, uint128 amountIn, uint128 minAmountOut) view returns (uint128 minBounty, uint128 defaultBounty, uint128 maxBounty)","function createOrder(((address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks) key, bool zeroForOne, uint128 amountIn, uint128 minAmountOut, uint160 sqrtPriceLimitX96, address recipient, uint40 expiry, uint128 bounty) params) payable returns (uint256 orderId)","function cancel(uint256 orderId, address to)","function getOrder(uint256 orderId) view returns (((address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks) key, address owner, uint40 createdAt, uint40 expiry, bool zeroForOne, uint8 status, address recipient, uint128 amountIn, uint128 minAmountOut, uint128 bounty, uint160 sqrtPriceLimitX96))","function quoteFill(uint256 orderId) view returns (bool fillable, uint256 amountOut)","function lastOrderId() view returns (uint256)","function liabilities(address currency) view returns (uint256)","function router() view returns (address)","function registry() view returns (address)","function poolManager() view returns (address)","function forwarder() view returns (address)","event OrderCreated(uint256 indexed orderId, address indexed owner, bytes32 indexed poolId, bool zeroForOne, uint128 amountIn, uint128 minAmountOut, uint128 bounty, uint40 expiry, address recipient)","event OrderCancelled(uint256 indexed orderId, address indexed owner, address indexed to, uint256 amountIn, uint256 bounty)"]);function B(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ge(e){let t=e.toLowerCase();return t===L.toLowerCase()||t===N.toLowerCase()||t===ae.toLowerCase()}function H(e,t){if(typeof e!="string"||!e.trim())throw new o(`Provide a valid contract address for ${t}. Identify tokens by chain and address, never by symbol.`);let n=e.trim();if(!$(n,{strict:!1}))throw new o(`Invalid token address "${n}" for ${t}. Identify tokens by chain and address, never by symbol.`);return ge(n)?L:l(n)}function be(e){let t=e===void 0?S:Number(e);if(!Number.isSafeInteger(t)||t!==S)throw new o(`Hookr limit orders are only supported on Robinhood Chain (${S}).`);return S}function Ze(e){switch(e){case J:return"None";case F:return"Open";case Ge:return"Filled";case Ye:return"Cancelled";default:return"Unknown"}}function Je(e,t,n=se){if(typeof e!="string"||!/^-?\d+$/.test(e.trim()))throw new o("Signed amount must be an integer string in base units.");let r=e.trim();if(r.startsWith("-")){let i=r.slice(1),u=n(i,t);return u==="0"?"0":`-${u}`}return n(r,t)}function xt(e,t,n="floor"){return ie(e,t,n)}function ke(e){return $e(fe(pe("address, address, uint24, int24, address"),[l(e.currency0),l(e.currency1),e.fee,e.tickSpacing,l(e.hooks)]))}function Oe(e,t){let n=e.toLowerCase();if(new Set([L.toLowerCase(),Fe.toLowerCase(),A.toLowerCase(),ve.toLowerCase(),Ne.toLowerCase(),Be.toLowerCase(),t.toLowerCase()]).has(n))throw new o(`Recipient ${e} is a reserved address and cannot receive Hookr limit order funds.`)}async function Z(e,t,n,r){if(ge(e))return{address:N,symbol:j.symbol,decimals:j.decimals,chainId:t};let i=l(e),u=i.toLowerCase();if(B(r)){let s=typeof r.decimals=="number"&&Number.isInteger(r.decimals)&&r.decimals>=0&&r.decimals<=255?r.decimals:void 0,a=typeof r.symbol=="string"&&r.symbol.trim()?r.symbol.trim():void 0;if(s!==void 0&&a!==void 0)return{address:i,symbol:a,decimals:s,chainId:t}}if(u===V.address.toLowerCase())return{...V,chainId:t};if(u===W.address.toLowerCase())return{...W,chainId:t};try{let[s,a]=await Promise.all([n.readContract({address:i,abi:Q,functionName:"symbol"}),n.readContract({address:i,abi:Q,functionName:"decimals"})]);if(typeof s!="string"||!s.trim()||typeof a!="number"||!Number.isInteger(a)||a<0||a>255)throw new o(`Invalid token metadata for ${i}.`);return{address:i,symbol:s.trim(),decimals:a,chainId:t}}catch{throw new o(`Could not read valid token metadata for ${i}. Refusing to guess token decimals.`)}}function et(e){let t=B(e.key)?e.key:B(e.poolKey)?e.poolKey:void 0,n=t?.fee??e.fee??Me,r=(typeof n=="string"&&/^\d+$/.test(n),Number(n));if(!Number.isInteger(r)||r<0||r>Ve)throw new o("Pool fee must be a valid uint24 integer (default 8388608 for Hookr dynamic fee pools).");let i=t?.tickSpacing??e.tickSpacing??ze,u=(typeof i=="string"&&/^-?\d+$/.test(i),Number(i));if(!Number.isInteger(u)||u<=0||u>We)throw new o("Pool tickSpacing must be a positive int24 integer.");let s=t?.hooks??e.hooks??_e;if(typeof s!="string"||!$(s,{strict:!1}))throw new o("Provide a valid Hookr root contract address for hooks.");let a=l(s);if(t?.currency0!==void 0&&t?.currency1!==void 0||e.currency0!==void 0&&e.currency1!==void 0){let m=H(t?.currency0??e.currency0,"currency0"),I=H(t?.currency1??e.currency1,"currency1");if(m.toLowerCase()===I.toLowerCase())throw new o("Pool currency0 and currency1 must be distinct token addresses.");if(BigInt(m)>=BigInt(I))throw new o("Pool currency0 must sort strictly before currency1 by address.");let k;if(typeof e.zeroForOne=="boolean")k=e.zeroForOne;else if(e.tokenIn!==void 0||e.from!==void 0){let C=H(e.tokenIn??e.from,"tokenIn");if(C.toLowerCase()===m.toLowerCase())k=!0;else if(C.toLowerCase()===I.toLowerCase())k=!1;else throw new o("tokenIn does not match currency0 or currency1 of the pool key.")}else throw new o("Provide zeroForOne (boolean) or tokenIn when specifying a pool key.");return{key:{currency0:m,currency1:I,fee:r,tickSpacing:u,hooks:a},zeroForOne:k}}let w=e.tokenIn??e.from,f=e.tokenOut??e.to;if(w===void 0||f===void 0)throw new o("Provide either key ({ currency0, currency1, fee, tickSpacing, hooks }) with zeroForOne or tokenIn and tokenOut addresses.");let g=H(w,"tokenIn"),b=H(f,"tokenOut");if(g.toLowerCase()===b.toLowerCase())throw new o("Input and output tokens must have distinct addresses.");let y=BigInt(g)<BigInt(b),p=y?g:b,d=y?b:g;if(typeof e.zeroForOne=="boolean"&&e.zeroForOne!==y)throw new o("zeroForOne conflicts with the canonical sorting of tokenIn and tokenOut.");return{key:{currency0:p,currency1:d,fee:r,tickSpacing:u,hooks:a},zeroForOne:y}}function tt(e,t,n){let r=G(t),i=r*r;if(n){let s=U(e.toString(),i.toString(),le.toString(),"ceil");return BigInt(s)}let u=U(e.toString(),le.toString(),i.toString(),"ceil");return BigInt(u)}function T(e,t){if(typeof e=="bigint"){if(e<0n)throw new o(`${t} must be a non-negative integer.`);return e}if(typeof e=="number"){if(!Number.isSafeInteger(e)||e<0)throw new o(`${t} must be a non-negative safe integer.`);return BigInt(e)}if(typeof e=="string")return R(e.trim());throw new o(`Provide ${t} as a decimal base-unit string.`)}async function nt(e,t){if(t!==void 0)return T(t,"now");if(typeof e.getBlock=="function"){let n=await e.getBlock().catch(()=>{throw new o("Could not read the chain timestamp for Hookr order expiry.")});return BigInt(n.timestamp)}throw new o("Could not read the chain timestamp for Hookr order expiry.")}function Ie(e,t){return!e.changes||e.changes.length===0?"no net ERC-20 transfer deltas":e.changes.map(n=>`${Je(n.amount,n.token.decimals,t.formatAmount)} ${n.token.symbol}`).join(", ")}function ot(e,t,n,r){if(!e||!Array.isArray(e.logs))throw new o("Provide a transaction receipt with a logs array.");for(let i of e.logs){if(!i||typeof i.address!="string"||!$(i.address,{strict:!1})||!Array.isArray(i.topics)||typeof i.data!="string"||i.topics.some(u=>typeof u!="string"||!/^0x[0-9a-fA-F]{64}$/.test(u)))throw new o(`Malformed Hookr ${t} receipt log.`);if(i.address.toLowerCase()===A.toLowerCase()&&i.topics[0]?.toLowerCase()===n.toLowerCase()){if(i.topics.length!==4||!/^0x0{24}/i.test(i.topics[2])||t==="OrderCancelled"&&!/^0x0{24}/i.test(i.topics[3])||!/^0x[0-9a-fA-F]*$/.test(i.data)||i.data.length!==2+r*64)throw new o(`Malformed Hookr ${t} receipt log.`);return{topics:i.topics,data:i.data}}}throw new o(`Could not find Hookr ${t} event in transaction receipt logs.`)}function Ae(e){if(e.receipt!==void 0){if(!B(e.receipt)||!Array.isArray(e.receipt.logs))throw new o("Provide a transaction receipt with a logs array.");return it({logs:e.receipt.logs})}if(e.logs!==void 0){if(!Array.isArray(e.logs))throw new o("Provide receipt logs as an array.");return rt(e.logs)}}function he(e){let t=ot(e,"OrderCreated",Qe,6);try{let n=He({abi:D,eventName:"OrderCreated",...t,strict:!0});if(fe(pe("bool, uint128, uint128, uint128, uint40, address"),[n.args.zeroForOne,n.args.amountIn,n.args.minAmountOut,n.args.bounty,n.args.expiry,n.args.recipient]).toLowerCase()!==t.data.toLowerCase())throw new o("Noncanonical Hookr OrderCreated event data.");return{orderId:n.args.orderId.toString(),owner:l(n.args.owner),poolId:n.args.poolId,zeroForOne:n.args.zeroForOne,amountIn:n.args.amountIn.toString(),minAmountOut:n.args.minAmountOut.toString(),bounty:n.args.bounty.toString(),expiry:n.args.expiry.toString(),recipient:l(n.args.recipient)}}catch{throw new o("Malformed Hookr OrderCreated receipt log.")}}function rt(e){return he({logs:e}).orderId}function it(e){return he(e).orderId}function Se(e){if(Array.isArray(e)){let[n,r,i,u,s,a,c,w,f,g,b]=e;return{key:Array.isArray(n)?{currency0:n[0],currency1:n[1],fee:Number(n[2]),tickSpacing:Number(n[3]),hooks:n[4]}:n,owner:r,createdAt:i,expiry:u,zeroForOne:s,status:a,recipient:c,amountIn:BigInt(w),minAmountOut:BigInt(f),bounty:BigInt(g),sqrtPriceLimitX96:BigInt(b)}}let t=e;return{key:{currency0:t.key.currency0,currency1:t.key.currency1,fee:Number(t.key.fee),tickSpacing:Number(t.key.tickSpacing),hooks:t.key.hooks},owner:t.owner,createdAt:t.createdAt,expiry:t.expiry,zeroForOne:!!t.zeroForOne,status:Number(t.status),recipient:t.recipient,amountIn:BigInt(t.amountIn),minAmountOut:BigInt(t.minAmountOut),bounty:BigInt(t.bounty),sqrtPriceLimitX96:BigInt(t.sqrtPriceLimitX96)}}async function Ce(e,t,n){let r=T(t,"orderId");if(r<=0n)throw new o("Order ID must be a positive integer.");let i=e.clientFor(S),u=n?.order??await i.readContract({address:A,abi:D,functionName:"getOrder",args:[r]}).catch(()=>{throw new o(`Could not read Hookr order #${r}. Order coverage is incomplete.`)}),s=Se(u),a=Number(s.status);if(s.owner.toLowerCase()===L.toLowerCase()||a===J)throw new o(`Hookr order #${r} does not exist.`);let c={currency0:l(s.key.currency0),currency1:l(s.key.currency1),fee:Number(s.key.fee),tickSpacing:Number(s.key.tickSpacing),hooks:l(s.key.hooks)},w=s.zeroForOne?c.currency0:c.currency1,f=s.zeroForOne?c.currency1:c.currency0,g=m=>{let I=m.toLowerCase(),k=n?.tokens.get(I);if(k)return k;let C=Z(m,S,i);return n?.tokens.set(I,C),C},[b,y]=await Promise.all([g(w),g(f)]),p=!1,d=0n;if(a===F)try{let m=await i.readContract({address:A,abi:D,functionName:"quoteFill",args:[r]});if(typeof m[0]!="boolean"||typeof m[1]!="bigint"||m[1]<0n)throw new o(`Invalid quote for Hookr order #${r}.`);p=m[0],d=m[1]}catch{throw new o(`Could not quote Hookr order #${r}. Fillability and output amount are unknown.`)}return{orderId:r.toString(),poolId:ke(c),key:c,owner:l(s.owner),recipient:l(s.recipient),createdAt:BigInt(s.createdAt).toString(),expiry:BigInt(s.expiry).toString(),zeroForOne:s.zeroForOne,status:a,statusLabel:Ze(a),amountIn:s.amountIn.toString(),minAmountOut:s.minAmountOut.toString(),bounty:s.bounty.toString(),sqrtPriceLimitX96:s.sqrtPriceLimitX96.toString(),tokenIn:b,tokenOut:y,fillable:p,quotedAmountOut:d.toString()}}function st(e){return{name:"hookr_create",inputSchema:{type:"object",properties:{key:{type:"object",properties:{currency0:{type:"string"},currency1:{type:"string"},fee:{type:"number"},tickSpacing:{type:"number"},hooks:{type:"string"}}},tokenIn:{type:"string",description:"Input token address on chain 4663."},tokenOut:{type:"string",description:"Output token address on chain 4663."},zeroForOne:{type:"boolean",description:"True when selling currency0 for currency1."},amountIn:{type:"string",description:"Input amount in base units (uint128)."},minAmountOut:{type:"string",description:"Minimum net output amount in base units (uint128)."},tick:{type:"number",description:"Optional limit tick in [-887272, 887272]."},expiry:{type:"string",description:"Order expiry unix timestamp in seconds (uint40)."},deadline:{type:"string",description:"Alias for expiry unix timestamp in seconds."},bounty:{type:"string",description:"Keeper bounty in native ETH wei (uint128)."},recipient:{type:"string",description:"Order output recipient address (must be the signing wallet)."},sqrtPriceLimitX96:{type:"string",description:"Optional sqrtPriceLimitX96 (defaults to 0)."},chainId:{type:"number",description:"Must be 4663 (Robinhood Chain)."}},required:["amountIn"]},async execute(t,n){v(n);let r=l(n),i=be(t.chainId),u=e.clientFor(i),s=Ae(t),{key:a,zeroForOne:c}=et(t),w=c?a.currency0:a.currency1,f=c?a.currency1:a.currency0,[g,b]=await Promise.all([Z(w,i,u,t.tokenInMeta),Z(f,i,u,t.tokenOutMeta)]),y=t.recipient??r;if(typeof y!="string"||!$(y,{strict:!1}))throw new o("Provide a valid recipient address for the Hookr limit order.");let p=l(y);if(Oe(p,a.hooks),p!==r)throw new o("Hookr recipient must be the signing wallet.");if(typeof t.amountIn!="string")throw new o("Provide amountIn as an integer string in base units.");let d=R(t.amountIn);if(d<=0n||d>Ke)throw new o("amountIn must be between 1 and int128.max base units.");if(t.tick!==void 0){let P=Number(t.tick);G(P)}let m;if(t.minAmountOut!==void 0){if(typeof t.minAmountOut!="string")throw new o("Provide minAmountOut as an integer string in base units.");m=R(t.minAmountOut)}else if(t.tick!==void 0)m=tt(d,Number(t.tick),c);else throw new o("Provide minAmountOut in base units (or tick to derive minAmountOut).");if(m<=0n||m>me)throw new o("minAmountOut must be between 1 and uint128.max base units.");let I=t.sqrtPriceLimitX96!==void 0?T(t.sqrtPriceLimitX96,"sqrtPriceLimitX96"):0n;if(I>Ue)throw new o("sqrtPriceLimitX96 exceeds uint160 bounds.");let k=await nt(u,t.now),C=t.expiry??t.deadline,O;if(C!==void 0)O=T(C,"expiry");else if(t.lifetime!==void 0||t.ttlSeconds!==void 0){let P=T(t.lifetime??t.ttlSeconds,"lifetime");O=k+P}else O=k+qe;if(O<k+de)throw new o(`Order expiry (${O}) is expired or below the minimum lifetime of ${de} seconds from block timestamp ${k}.`);if(O>k+ce||O>je)throw new o(`Order expiry (${O}) exceeds the maximum lifetime of ${ce} seconds (365 days).`);let M=await u.readContract({address:A,abi:D,functionName:"bountyBounds",args:[a,c,d,m]}).catch(()=>{throw new o("Could not read Hookr bounty bounds.")}),E=BigInt(M[0]),z=BigInt(M[1]),q=BigInt(M[2]);if(t.bounty!==void 0&&typeof t.bounty!="string")throw new o("Provide bounty as an integer string in base units.");let h=t.bounty!==void 0?R(t.bounty):z,X=E>0n?E:z;if(h<E||X>0n&&h<X)throw new o(`Order keeper bounty (${h} wei) is underbounty: must be at least ${X} wei (default keeper bounty floor).`);if(h>q||h>me)throw new o(`Order keeper bounty (${h} wei) exceeds the maximum allowed bounty of ${q} wei.`);let ee=w.toLowerCase()===L.toLowerCase(),_=[];if(!ee){let P;try{let K=await u.readContract({address:w,abi:Q,functionName:"allowance",args:[r,A]});if(typeof K!="bigint"||K<0n)throw new o("Invalid token allowance.");P=K}catch{throw new o(`Could not read token allowance for ${w}. No approval was prepared.`)}P<d&&_.push(e.approval(w,A,d.toString(),i))}let De=ee?d+h:h,Le=ye({abi:D,functionName:"createOrder",args:[{key:a,zeroForOne:c,amountIn:d,minAmountOut:m,sqrtPriceLimitX96:I,recipient:p,expiry:Number(O),bounty:h}]}),te=e.formatAmount(d.toString(),g.decimals),ne=e.formatAmount(m.toString(),b.decimals),oe=e.formatAmount(h.toString(),18),Pe=e.unsignedTx({to:A,data:Le,value:De.toString(),chainId:i,description:`Create Hookr limit order on ${A}: sell ${te} ${g.symbol} (${g.address}) for at least ${ne} ${b.symbol} (${b.address}) with ${oe} ETH keeper bounty (fee=${a.fee}, tickSpacing=${a.tickSpacing}, expiry=${O}).`});_.push(Pe);let re=await e.preview(_,r),Te=Ie(re,e),Re=ke(a);return{txs:_,summary:`Hookr limit order prepared: sell ${te} ${g.symbol} for at least ${ne} ${b.symbol} (bounty ${oe} ETH, expiry ${O}; preview deltas: ${Te}).`,preview:re,poolId:Re,key:a,zeroForOne:c,amountIn:d.toString(),minAmountOut:m.toString(),bounty:h.toString(),bountyBounds:{minBounty:E.toString(),defaultBounty:z.toString(),maxBounty:q.toString()},expiry:O.toString(),recipient:p,sqrtPriceLimitX96:I.toString(),tokenIn:g,tokenOut:b,...s!==void 0?{orderId:s}:{}}}}}function at(e){return{name:"hookr_cancel",inputSchema:{type:"object",properties:{orderId:{type:"string",description:"Hookr order ID to cancel (uint256 decimal string)."},to:{type:"string",description:"Recipient address for the refunded principal and bounty (must be the signing wallet)."},chainId:{type:"number",description:"Must be 4663 (Robinhood Chain)."}},required:["orderId"]},async execute(t,n){v(n);let r=l(n),i=be(t.chainId),u=Ae(t),s=t.orderId??t.id??u;if(s===void 0)throw new o("Provide orderId to cancel a Hookr limit order.");let a=T(s,"orderId");if(a<=0n)throw new o("orderId must be a positive integer.");let c=await Ce(e,a);if(c.owner.toLowerCase()!==r.toLowerCase())throw new o(`Unauthorized cancellation: only the order owner (${c.owner}) can cancel Hookr order #${a} (caller is ${r}).`);if(c.status!==F)throw new o(`Hookr order #${a} is not open (current status: ${c.statusLabel}).`);let w=t.to??r;if(typeof w!="string"||!$(w,{strict:!1}))throw new o("Provide a valid refund recipient address for cancel.");let f=l(w);if(Oe(f,c.key.hooks),f!==r)throw new o("Hookr refund recipient must be the signing wallet.");let g=ye({abi:D,functionName:"cancel",args:[a,f]}),b=e.formatAmount(c.amountIn,c.tokenIn.decimals),y=e.formatAmount(c.bounty,18),p=e.unsignedTx({to:A,data:g,value:"0",chainId:i,description:`Cancel Hookr limit order #${a} on ${A} and refund ${b} ${c.tokenIn.symbol} plus ${y} ETH bounty to ${f}.`}),d=await e.preview([p],r),m=Ie(d,e);return{txs:[p],summary:`Cancel Hookr limit order #${a}: refund ${b} ${c.tokenIn.symbol} and ${y} ETH bounty to ${f} (preview deltas: ${m}).`,preview:d,orderId:a.toString(),to:f,refundedAmountIn:c.amountIn,refundedBounty:c.bounty,tokenIn:c.tokenIn,tokenOut:c.tokenOut}}}}function dt(e){let t=performance.now()+Xe;return new Proxy(e,{get(n,r,i){return r!=="readContract"?Reflect.get(n,r,i):async(...u)=>{let s=t-performance.now(),a=()=>new o("Hookr scan deadline exceeded. Order coverage is incomplete; retry later.");if(s<=0)throw a();let c;try{return await Promise.race([n.readContract(...u),new Promise((w,f)=>{c=setTimeout(()=>f(a()),s)})])}finally{c!==void 0&&clearTimeout(c)}}}})}function ct(e){return async t=>{v(t);let n=l(t),r=dt(e.clientFor(S)),i={...e,clientFor:()=>r},u=await r.readContract({address:A,abi:D,functionName:"lastOrderId"}).catch(()=>{throw new o("Could not read the last Hookr order ID. Order coverage is incomplete.")});if(typeof u!="bigint"||u<0n)throw new o("Could not read a valid last Hookr order ID. Order coverage is incomplete.");let s=u,a=s>ue?s-ue+1n:1n;if(s<=0n)return[];let c=[],w=new Map;for(let f=a;f<=s;f+=Y){let g=Array.from({length:Number(s-f+1n<Y?s-f+1n:Y)},(y,p)=>f+BigInt(p)),b=await Promise.all(g.map(async y=>{let p=await r.readContract({address:A,abi:D,functionName:"getOrder",args:[y]}).catch(()=>{throw new o(`Could not read Hookr order #${y}. Order coverage is incomplete.`)}),d=Se(p);if(d.owner.toLowerCase()===L||Number(d.status)===J)throw new o(`Hookr order #${y} does not exist. Order coverage is incomplete.`);return{id:y,order:d}}));for(let{id:y,order:p}of b){if(p.owner.toLowerCase()!==n.toLowerCase()||Number(p.status)!==F)continue;let d=await Ce(i,y,{order:p,tokens:w}),m=[{token:d.tokenIn,amount:d.amountIn}];BigInt(d.bounty)>0n&&m.push({token:{address:N,symbol:"ETH",decimals:18,chainId:S},amount:d.bounty});let I=e.formatAmount(d.amountIn,d.tokenIn.decimals),k=e.formatAmount(d.minAmountOut,d.tokenOut.decimals),C=e.formatAmount(d.bounty,18),O=e.formatAmount(d.quotedAmountOut,d.tokenOut.decimals);c.push({module:"hookr",id:d.orderId,chainId:S,assets:m,description:`Hookr open limit order #${d.orderId}: sell ${I} ${d.tokenIn.symbol} (${d.tokenIn.address}) for at least ${k} ${d.tokenOut.symbol} (${d.tokenOut.address}), bounty ${C} ETH, expiry ${d.expiry}, fillable=${d.fillable} (quoted output ${O} ${d.tokenOut.symbol}).`})}}return a>1n&&c.push({module:"hookr",id:"coverage",chainId:S,assets:[],description:`Hookr order coverage is incomplete: scanned IDs ${a}-${s}. Older orders require an explicit order ID.`}),c}}var xe=e=>{let t=[st(e),at(e)],n=ct(e);return{tools:t,positions:n}},Dt=xe,Lt=xe;export{A as a,_e as b,ve as c,kt as d,Ne as e,Be as f,Ot as g,Fe as h,Me as i,ze as j,de as k,qe as l,ce as m,It as n,At as o,ht as p,St as q,ue as r,Xe as s,J as t,F as u,Ge as v,Ye as w,Qe as x,Ct as y,D as z,Je as A,xt as B,ke as C,ot as D,he as E,rt as F,it as G,Se as H,Ce as I,st as J,at as K,dt as L,ct as M,xe as N,Dt as O,Lt as P};
|
|
1
|
+
import{i as G}from"./FUXT7GRK.js";import{b as j,c as V,d as W}from"./JPOYTTTW.js";import{d as ae,e as L}from"./5O5ZE3ZV.js";import{a as N}from"./CY75R4FK.js";import{a as v}from"./6IM6A5VA.js";import{a as R,b as ie,c as se,d as U}from"./RETS2ZEK.js";import{a as S,i as x}from"./G6HCV67X.js";import{a as o}from"./5YS5V2LK.js";import{decodeEventLog as He,encodeAbiParameters as fe,encodeFunctionData as ye,erc20Abi as Q,getAddress as l,isAddress as $,keccak256 as $e,parseAbi as Ee,parseAbiParameters as pe,toEventSelector as we}from"viem";var A=l(x[4663].hookr.HookrLimitOrders.address),_e=l(x[4663].hookr.HookrRoot.address),ve=l(x[4663].hookr.HookrRouter.address),kt=l(x[4663].hookr.HookrRegistry.address),Ne=l(x[4663].hookr.HookrForwarder.address),Be=l(x[4663].hookr.PoolManager.address),Ot=l(x[4663].hookr.HOOKR_Token.address),Fe=l("0x000000000000000000000000000000000000dEaD"),Me=8388608,ze=200,de=60n,qe=604800n,ce=31536000n,It=10,At=100,ht="500000000000000",St="10000000000000000",ue=4096n,Y=32n,Xe=1e4,Ke=(1n<<127n)-1n,me=(1n<<128n)-1n,Ue=(1n<<160n)-1n,je=(1n<<40n)-1n,Ve=16777215,We=8388607,le=1n<<192n,J=0,F=1,Ge=2,Ye=3,Qe=we("OrderCreated(uint256,address,bytes32,bool,uint128,uint128,uint128,uint40,address)"),Ct=we("OrderCancelled(uint256,address,address,uint256,uint256)"),D=Ee(["function bountyBounds((address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks) key, bool zeroForOne, uint128 amountIn, uint128 minAmountOut) view returns (uint128 minBounty, uint128 defaultBounty, uint128 maxBounty)","function createOrder(((address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks) key, bool zeroForOne, uint128 amountIn, uint128 minAmountOut, uint160 sqrtPriceLimitX96, address recipient, uint40 expiry, uint128 bounty) params) payable returns (uint256 orderId)","function cancel(uint256 orderId, address to)","function getOrder(uint256 orderId) view returns (((address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks) key, address owner, uint40 createdAt, uint40 expiry, bool zeroForOne, uint8 status, address recipient, uint128 amountIn, uint128 minAmountOut, uint128 bounty, uint160 sqrtPriceLimitX96))","function quoteFill(uint256 orderId) view returns (bool fillable, uint256 amountOut)","function lastOrderId() view returns (uint256)","function liabilities(address currency) view returns (uint256)","function router() view returns (address)","function registry() view returns (address)","function poolManager() view returns (address)","function forwarder() view returns (address)","event OrderCreated(uint256 indexed orderId, address indexed owner, bytes32 indexed poolId, bool zeroForOne, uint128 amountIn, uint128 minAmountOut, uint128 bounty, uint40 expiry, address recipient)","event OrderCancelled(uint256 indexed orderId, address indexed owner, address indexed to, uint256 amountIn, uint256 bounty)"]);function B(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ge(e){let t=e.toLowerCase();return t===L.toLowerCase()||t===N.toLowerCase()||t===ae.toLowerCase()}function H(e,t){if(typeof e!="string"||!e.trim())throw new o(`Provide a valid contract address for ${t}. Identify tokens by chain and address, never by symbol.`);let n=e.trim();if(!$(n,{strict:!1}))throw new o(`Invalid token address "${n}" for ${t}. Identify tokens by chain and address, never by symbol.`);return ge(n)?L:l(n)}function be(e){let t=e===void 0?S:Number(e);if(!Number.isSafeInteger(t)||t!==S)throw new o(`Hookr limit orders are only supported on Robinhood Chain (${S}).`);return S}function Ze(e){switch(e){case J:return"None";case F:return"Open";case Ge:return"Filled";case Ye:return"Cancelled";default:return"Unknown"}}function Je(e,t,n=se){if(typeof e!="string"||!/^-?\d+$/.test(e.trim()))throw new o("Signed amount must be an integer string in base units.");let r=e.trim();if(r.startsWith("-")){let i=r.slice(1),u=n(i,t);return u==="0"?"0":`-${u}`}return n(r,t)}function xt(e,t,n="floor"){return ie(e,t,n)}function ke(e){return $e(fe(pe("address, address, uint24, int24, address"),[l(e.currency0),l(e.currency1),e.fee,e.tickSpacing,l(e.hooks)]))}function Oe(e,t){let n=e.toLowerCase();if(new Set([L.toLowerCase(),Fe.toLowerCase(),A.toLowerCase(),ve.toLowerCase(),Ne.toLowerCase(),Be.toLowerCase(),t.toLowerCase()]).has(n))throw new o(`Recipient ${e} is a reserved address and cannot receive Hookr limit order funds.`)}async function Z(e,t,n,r){if(ge(e))return{address:N,symbol:j.symbol,decimals:j.decimals,chainId:t};let i=l(e),u=i.toLowerCase();if(B(r)){let s=typeof r.decimals=="number"&&Number.isInteger(r.decimals)&&r.decimals>=0&&r.decimals<=255?r.decimals:void 0,a=typeof r.symbol=="string"&&r.symbol.trim()?r.symbol.trim():void 0;if(s!==void 0&&a!==void 0)return{address:i,symbol:a,decimals:s,chainId:t}}if(u===V.address.toLowerCase())return{...V,chainId:t};if(u===W.address.toLowerCase())return{...W,chainId:t};try{let[s,a]=await Promise.all([n.readContract({address:i,abi:Q,functionName:"symbol"}),n.readContract({address:i,abi:Q,functionName:"decimals"})]);if(typeof s!="string"||!s.trim()||typeof a!="number"||!Number.isInteger(a)||a<0||a>255)throw new o(`Invalid token metadata for ${i}.`);return{address:i,symbol:s.trim(),decimals:a,chainId:t}}catch{throw new o(`Could not read valid token metadata for ${i}. Refusing to guess token decimals.`)}}function et(e){let t=B(e.key)?e.key:B(e.poolKey)?e.poolKey:void 0,n=t?.fee??e.fee??Me,r=(typeof n=="string"&&/^\d+$/.test(n),Number(n));if(!Number.isInteger(r)||r<0||r>Ve)throw new o("Pool fee must be a valid uint24 integer (default 8388608 for Hookr dynamic fee pools).");let i=t?.tickSpacing??e.tickSpacing??ze,u=(typeof i=="string"&&/^-?\d+$/.test(i),Number(i));if(!Number.isInteger(u)||u<=0||u>We)throw new o("Pool tickSpacing must be a positive int24 integer.");let s=t?.hooks??e.hooks??_e;if(typeof s!="string"||!$(s,{strict:!1}))throw new o("Provide a valid Hookr root contract address for hooks.");let a=l(s);if(t?.currency0!==void 0&&t?.currency1!==void 0||e.currency0!==void 0&&e.currency1!==void 0){let m=H(t?.currency0??e.currency0,"currency0"),I=H(t?.currency1??e.currency1,"currency1");if(m.toLowerCase()===I.toLowerCase())throw new o("Pool currency0 and currency1 must be distinct token addresses.");if(BigInt(m)>=BigInt(I))throw new o("Pool currency0 must sort strictly before currency1 by address.");let k;if(typeof e.zeroForOne=="boolean")k=e.zeroForOne;else if(e.tokenIn!==void 0||e.from!==void 0){let C=H(e.tokenIn??e.from,"tokenIn");if(C.toLowerCase()===m.toLowerCase())k=!0;else if(C.toLowerCase()===I.toLowerCase())k=!1;else throw new o("tokenIn does not match currency0 or currency1 of the pool key.")}else throw new o("Provide zeroForOne (boolean) or tokenIn when specifying a pool key.");return{key:{currency0:m,currency1:I,fee:r,tickSpacing:u,hooks:a},zeroForOne:k}}let w=e.tokenIn??e.from,f=e.tokenOut??e.to;if(w===void 0||f===void 0)throw new o("Provide either key ({ currency0, currency1, fee, tickSpacing, hooks }) with zeroForOne or tokenIn and tokenOut addresses.");let g=H(w,"tokenIn"),b=H(f,"tokenOut");if(g.toLowerCase()===b.toLowerCase())throw new o("Input and output tokens must have distinct addresses.");let y=BigInt(g)<BigInt(b),p=y?g:b,d=y?b:g;if(typeof e.zeroForOne=="boolean"&&e.zeroForOne!==y)throw new o("zeroForOne conflicts with the canonical sorting of tokenIn and tokenOut.");return{key:{currency0:p,currency1:d,fee:r,tickSpacing:u,hooks:a},zeroForOne:y}}function tt(e,t,n){let r=G(t),i=r*r;if(n){let s=U(e.toString(),i.toString(),le.toString(),"ceil");return BigInt(s)}let u=U(e.toString(),le.toString(),i.toString(),"ceil");return BigInt(u)}function T(e,t){if(typeof e=="bigint"){if(e<0n)throw new o(`${t} must be a non-negative integer.`);return e}if(typeof e=="number"){if(!Number.isSafeInteger(e)||e<0)throw new o(`${t} must be a non-negative safe integer.`);return BigInt(e)}if(typeof e=="string")return R(e.trim());throw new o(`Provide ${t} as a decimal base-unit string.`)}async function nt(e,t){if(t!==void 0)return T(t,"now");if(typeof e.getBlock=="function"){let n=await e.getBlock().catch(()=>{throw new o("Could not read the chain timestamp for Hookr order expiry.")});return BigInt(n.timestamp)}throw new o("Could not read the chain timestamp for Hookr order expiry.")}function Ie(e,t){return!e.changes||e.changes.length===0?"no net ERC-20 transfer deltas":e.changes.map(n=>`${Je(n.amount,n.token.decimals,t.formatAmount)} ${n.token.symbol}`).join(", ")}function ot(e,t,n,r){if(!e||!Array.isArray(e.logs))throw new o("Provide a transaction receipt with a logs array.");for(let i of e.logs){if(!i||typeof i.address!="string"||!$(i.address,{strict:!1})||!Array.isArray(i.topics)||typeof i.data!="string"||i.topics.some(u=>typeof u!="string"||!/^0x[0-9a-fA-F]{64}$/.test(u)))throw new o(`Malformed Hookr ${t} receipt log.`);if(i.address.toLowerCase()===A.toLowerCase()&&i.topics[0]?.toLowerCase()===n.toLowerCase()){if(i.topics.length!==4||!/^0x0{24}/i.test(i.topics[2])||t==="OrderCancelled"&&!/^0x0{24}/i.test(i.topics[3])||!/^0x[0-9a-fA-F]*$/.test(i.data)||i.data.length!==2+r*64)throw new o(`Malformed Hookr ${t} receipt log.`);return{topics:i.topics,data:i.data}}}throw new o(`Could not find Hookr ${t} event in transaction receipt logs.`)}function Ae(e){if(e.receipt!==void 0){if(!B(e.receipt)||!Array.isArray(e.receipt.logs))throw new o("Provide a transaction receipt with a logs array.");return it({logs:e.receipt.logs})}if(e.logs!==void 0){if(!Array.isArray(e.logs))throw new o("Provide receipt logs as an array.");return rt(e.logs)}}function he(e){let t=ot(e,"OrderCreated",Qe,6);try{let n=He({abi:D,eventName:"OrderCreated",...t,strict:!0});if(fe(pe("bool, uint128, uint128, uint128, uint40, address"),[n.args.zeroForOne,n.args.amountIn,n.args.minAmountOut,n.args.bounty,n.args.expiry,n.args.recipient]).toLowerCase()!==t.data.toLowerCase())throw new o("Noncanonical Hookr OrderCreated event data.");return{orderId:n.args.orderId.toString(),owner:l(n.args.owner),poolId:n.args.poolId,zeroForOne:n.args.zeroForOne,amountIn:n.args.amountIn.toString(),minAmountOut:n.args.minAmountOut.toString(),bounty:n.args.bounty.toString(),expiry:n.args.expiry.toString(),recipient:l(n.args.recipient)}}catch{throw new o("Malformed Hookr OrderCreated receipt log.")}}function rt(e){return he({logs:e}).orderId}function it(e){return he(e).orderId}function Se(e){if(Array.isArray(e)){let[n,r,i,u,s,a,c,w,f,g,b]=e;return{key:Array.isArray(n)?{currency0:n[0],currency1:n[1],fee:Number(n[2]),tickSpacing:Number(n[3]),hooks:n[4]}:n,owner:r,createdAt:i,expiry:u,zeroForOne:s,status:a,recipient:c,amountIn:BigInt(w),minAmountOut:BigInt(f),bounty:BigInt(g),sqrtPriceLimitX96:BigInt(b)}}let t=e;return{key:{currency0:t.key.currency0,currency1:t.key.currency1,fee:Number(t.key.fee),tickSpacing:Number(t.key.tickSpacing),hooks:t.key.hooks},owner:t.owner,createdAt:t.createdAt,expiry:t.expiry,zeroForOne:!!t.zeroForOne,status:Number(t.status),recipient:t.recipient,amountIn:BigInt(t.amountIn),minAmountOut:BigInt(t.minAmountOut),bounty:BigInt(t.bounty),sqrtPriceLimitX96:BigInt(t.sqrtPriceLimitX96)}}async function Ce(e,t,n){let r=T(t,"orderId");if(r<=0n)throw new o("Order ID must be a positive integer.");let i=e.clientFor(S),u=n?.order??await i.readContract({address:A,abi:D,functionName:"getOrder",args:[r]}).catch(()=>{throw new o(`Could not read Hookr order #${r}. Order coverage is incomplete.`)}),s=Se(u),a=Number(s.status);if(s.owner.toLowerCase()===L.toLowerCase()||a===J)throw new o(`Hookr order #${r} does not exist.`);let c={currency0:l(s.key.currency0),currency1:l(s.key.currency1),fee:Number(s.key.fee),tickSpacing:Number(s.key.tickSpacing),hooks:l(s.key.hooks)},w=s.zeroForOne?c.currency0:c.currency1,f=s.zeroForOne?c.currency1:c.currency0,g=m=>{let I=m.toLowerCase(),k=n?.tokens.get(I);if(k)return k;let C=Z(m,S,i);return n?.tokens.set(I,C),C},[b,y]=await Promise.all([g(w),g(f)]),p=!1,d=0n;if(a===F)try{let m=await i.readContract({address:A,abi:D,functionName:"quoteFill",args:[r]});if(typeof m[0]!="boolean"||typeof m[1]!="bigint"||m[1]<0n)throw new o(`Invalid quote for Hookr order #${r}.`);p=m[0],d=m[1]}catch{throw new o(`Could not quote Hookr order #${r}. Fillability and output amount are unknown.`)}return{orderId:r.toString(),poolId:ke(c),key:c,owner:l(s.owner),recipient:l(s.recipient),createdAt:BigInt(s.createdAt).toString(),expiry:BigInt(s.expiry).toString(),zeroForOne:s.zeroForOne,status:a,statusLabel:Ze(a),amountIn:s.amountIn.toString(),minAmountOut:s.minAmountOut.toString(),bounty:s.bounty.toString(),sqrtPriceLimitX96:s.sqrtPriceLimitX96.toString(),tokenIn:b,tokenOut:y,fillable:p,quotedAmountOut:d.toString()}}function st(e){return{name:"hookr_create",inputSchema:{type:"object",properties:{key:{type:"object",properties:{currency0:{type:"string"},currency1:{type:"string"},fee:{type:"number"},tickSpacing:{type:"number"},hooks:{type:"string"}}},tokenIn:{type:"string",description:"Input token address on chain 4663."},tokenOut:{type:"string",description:"Output token address on chain 4663."},zeroForOne:{type:"boolean",description:"True when selling currency0 for currency1."},amountIn:{type:"string",description:"Input amount in base units (uint128)."},minAmountOut:{type:"string",description:"Minimum net output amount in base units (uint128)."},tick:{type:"number",description:"Optional limit tick in [-887272, 887272]."},expiry:{type:"string",description:"Order expiry unix timestamp in seconds (uint40)."},deadline:{type:"string",description:"Alias for expiry unix timestamp in seconds."},bounty:{type:"string",description:"Keeper bounty in native ETH wei (uint128)."},recipient:{type:"string",description:"Order output recipient address (must be the signing wallet)."},sqrtPriceLimitX96:{type:"string",description:"Optional sqrtPriceLimitX96 (defaults to 0)."},chainId:{type:"number",description:"Must be 4663 (Robinhood Chain)."}},required:["amountIn"]},async execute(t,n){v(n);let r=l(n),i=be(t.chainId),u=e.clientFor(i),s=Ae(t),{key:a,zeroForOne:c}=et(t),w=c?a.currency0:a.currency1,f=c?a.currency1:a.currency0,[g,b]=await Promise.all([Z(w,i,u,t.tokenInMeta),Z(f,i,u,t.tokenOutMeta)]),y=t.recipient??r;if(typeof y!="string"||!$(y,{strict:!1}))throw new o("Provide a valid recipient address for the Hookr limit order.");let p=l(y);if(Oe(p,a.hooks),p!==r)throw new o("Hookr recipient must be the signing wallet.");if(typeof t.amountIn!="string")throw new o("Provide amountIn as an integer string in base units.");let d=R(t.amountIn);if(d<=0n||d>Ke)throw new o("amountIn must be between 1 and int128.max base units.");if(t.tick!==void 0){let P=Number(t.tick);G(P)}let m;if(t.minAmountOut!==void 0){if(typeof t.minAmountOut!="string")throw new o("Provide minAmountOut as an integer string in base units.");m=R(t.minAmountOut)}else if(t.tick!==void 0)m=tt(d,Number(t.tick),c);else throw new o("Provide minAmountOut in base units (or tick to derive minAmountOut).");if(m<=0n||m>me)throw new o("minAmountOut must be between 1 and uint128.max base units.");let I=t.sqrtPriceLimitX96!==void 0?T(t.sqrtPriceLimitX96,"sqrtPriceLimitX96"):0n;if(I>Ue)throw new o("sqrtPriceLimitX96 exceeds uint160 bounds.");let k=await nt(u,t.now),C=t.expiry??t.deadline,O;if(C!==void 0)O=T(C,"expiry");else if(t.lifetime!==void 0||t.ttlSeconds!==void 0){let P=T(t.lifetime??t.ttlSeconds,"lifetime");O=k+P}else O=k+qe;if(O<k+de)throw new o(`Order expiry (${O}) is expired or below the minimum lifetime of ${de} seconds from block timestamp ${k}.`);if(O>k+ce||O>je)throw new o(`Order expiry (${O}) exceeds the maximum lifetime of ${ce} seconds (365 days).`);let M=await u.readContract({address:A,abi:D,functionName:"bountyBounds",args:[a,c,d,m]}).catch(()=>{throw new o("Could not read Hookr bounty bounds.")}),E=BigInt(M[0]),z=BigInt(M[1]),q=BigInt(M[2]);if(t.bounty!==void 0&&typeof t.bounty!="string")throw new o("Provide bounty as an integer string in base units.");let h=t.bounty!==void 0?R(t.bounty):z,X=E>0n?E:z;if(h<E||X>0n&&h<X)throw new o(`Order keeper bounty (${h} wei) is underbounty: must be at least ${X} wei (default keeper bounty floor).`);if(h>q||h>me)throw new o(`Order keeper bounty (${h} wei) exceeds the maximum allowed bounty of ${q} wei.`);let ee=w.toLowerCase()===L.toLowerCase(),_=[];if(!ee){let P;try{let K=await u.readContract({address:w,abi:Q,functionName:"allowance",args:[r,A]});if(typeof K!="bigint"||K<0n)throw new o("Invalid token allowance.");P=K}catch{throw new o(`Could not read token allowance for ${w}. No approval was prepared.`)}P<d&&_.push(e.approval(w,A,d.toString(),i))}let De=ee?d+h:h,Le=ye({abi:D,functionName:"createOrder",args:[{key:a,zeroForOne:c,amountIn:d,minAmountOut:m,sqrtPriceLimitX96:I,recipient:p,expiry:Number(O),bounty:h}]}),te=e.formatAmount(d.toString(),g.decimals),ne=e.formatAmount(m.toString(),b.decimals),oe=e.formatAmount(h.toString(),18),Pe=e.unsignedTx({to:A,data:Le,value:De.toString(),chainId:i,description:`Create Hookr limit order on ${A}: sell ${te} ${g.symbol} (${g.address}) for at least ${ne} ${b.symbol} (${b.address}) with ${oe} ETH keeper bounty (fee=${a.fee}, tickSpacing=${a.tickSpacing}, expiry=${O}).`});_.push(Pe);let re=await e.preview(_,r),Te=Ie(re,e),Re=ke(a);return{txs:_,summary:`Hookr limit order prepared: sell ${te} ${g.symbol} for at least ${ne} ${b.symbol} (bounty ${oe} ETH, expiry ${O}; preview deltas: ${Te}).`,preview:re,poolId:Re,key:a,zeroForOne:c,amountIn:d.toString(),minAmountOut:m.toString(),bounty:h.toString(),bountyBounds:{minBounty:E.toString(),defaultBounty:z.toString(),maxBounty:q.toString()},expiry:O.toString(),recipient:p,sqrtPriceLimitX96:I.toString(),tokenIn:g,tokenOut:b,...s!==void 0?{orderId:s}:{}}}}}function at(e){return{name:"hookr_cancel",inputSchema:{type:"object",properties:{orderId:{type:"string",description:"Hookr order ID to cancel (uint256 decimal string)."},to:{type:"string",description:"Recipient address for the refunded principal and bounty (must be the signing wallet)."},chainId:{type:"number",description:"Must be 4663 (Robinhood Chain)."}},required:["orderId"]},async execute(t,n){v(n);let r=l(n),i=be(t.chainId),u=Ae(t),s=t.orderId??t.id??u;if(s===void 0)throw new o("Provide orderId to cancel a Hookr limit order.");let a=T(s,"orderId");if(a<=0n)throw new o("orderId must be a positive integer.");let c=await Ce(e,a);if(c.owner.toLowerCase()!==r.toLowerCase())throw new o(`Unauthorized cancellation: only the order owner (${c.owner}) can cancel Hookr order #${a} (caller is ${r}).`);if(c.status!==F)throw new o(`Hookr order #${a} is not open (current status: ${c.statusLabel}).`);let w=t.to??r;if(typeof w!="string"||!$(w,{strict:!1}))throw new o("Provide a valid refund recipient address for cancel.");let f=l(w);if(Oe(f,c.key.hooks),f!==r)throw new o("Hookr refund recipient must be the signing wallet.");let g=ye({abi:D,functionName:"cancel",args:[a,f]}),b=e.formatAmount(c.amountIn,c.tokenIn.decimals),y=e.formatAmount(c.bounty,18),p=e.unsignedTx({to:A,data:g,value:"0",chainId:i,description:`Cancel Hookr limit order #${a} on ${A} and refund ${b} ${c.tokenIn.symbol} plus ${y} ETH bounty to ${f}.`}),d=await e.preview([p],r),m=Ie(d,e);return{txs:[p],summary:`Cancel Hookr limit order #${a}: refund ${b} ${c.tokenIn.symbol} and ${y} ETH bounty to ${f} (preview deltas: ${m}).`,preview:d,orderId:a.toString(),to:f,refundedAmountIn:c.amountIn,refundedBounty:c.bounty,tokenIn:c.tokenIn,tokenOut:c.tokenOut}}}}function dt(e){let t=performance.now()+Xe;return new Proxy(e,{get(n,r,i){return r!=="readContract"?Reflect.get(n,r,i):async(...u)=>{let s=t-performance.now(),a=()=>new o("Hookr scan deadline exceeded. Order coverage is incomplete; retry later.");if(s<=0)throw a();let c;try{return await Promise.race([n.readContract(...u),new Promise((w,f)=>{c=setTimeout(()=>f(a()),s)})])}finally{c!==void 0&&clearTimeout(c)}}}})}function ct(e){return async t=>{v(t);let n=l(t),r=dt(e.clientFor(S)),i={...e,clientFor:()=>r},u=await r.readContract({address:A,abi:D,functionName:"lastOrderId"}).catch(()=>{throw new o("Could not read the last Hookr order ID. Order coverage is incomplete.")});if(typeof u!="bigint"||u<0n)throw new o("Could not read a valid last Hookr order ID. Order coverage is incomplete.");let s=u,a=s>ue?s-ue+1n:1n;if(s<=0n)return[];let c=[],w=new Map;for(let f=a;f<=s;f+=Y){let g=Array.from({length:Number(s-f+1n<Y?s-f+1n:Y)},(y,p)=>f+BigInt(p)),b=await Promise.all(g.map(async y=>{let p=await r.readContract({address:A,abi:D,functionName:"getOrder",args:[y]}).catch(()=>{throw new o(`Could not read Hookr order #${y}. Order coverage is incomplete.`)}),d=Se(p);if(d.owner.toLowerCase()===L||Number(d.status)===J)throw new o(`Hookr order #${y} does not exist. Order coverage is incomplete.`);return{id:y,order:d}}));for(let{id:y,order:p}of b){if(p.owner.toLowerCase()!==n.toLowerCase()||Number(p.status)!==F)continue;let d=await Ce(i,y,{order:p,tokens:w}),m=[{token:d.tokenIn,amount:d.amountIn}];BigInt(d.bounty)>0n&&m.push({token:{address:N,symbol:"ETH",decimals:18,chainId:S},amount:d.bounty});let I=e.formatAmount(d.amountIn,d.tokenIn.decimals),k=e.formatAmount(d.minAmountOut,d.tokenOut.decimals),C=e.formatAmount(d.bounty,18),O=e.formatAmount(d.quotedAmountOut,d.tokenOut.decimals);c.push({module:"hookr",id:d.orderId,chainId:S,assets:m,description:`Hookr open limit order #${d.orderId}: sell ${I} ${d.tokenIn.symbol} (${d.tokenIn.address}) for at least ${k} ${d.tokenOut.symbol} (${d.tokenOut.address}), bounty ${C} ETH, expiry ${d.expiry}, fillable=${d.fillable} (quoted output ${O} ${d.tokenOut.symbol}).`})}}return a>1n&&c.push({module:"hookr",id:"coverage",chainId:S,assets:[],description:`Hookr order coverage is incomplete: scanned IDs ${a}-${s}. Older orders require an explicit order ID.`}),c}}var xe=e=>{let t=[st(e),at(e)],n=ct(e);return{tools:t,positions:n}},Dt=xe,Lt=xe;export{A as a,_e as b,ve as c,kt as d,Ne as e,Be as f,Ot as g,Fe as h,Me as i,ze as j,de as k,qe as l,ce as m,It as n,At as o,ht as p,St as q,ue as r,Xe as s,J as t,F as u,Ge as v,Ye as w,Qe as x,Ct as y,D as z,Je as A,xt as B,ke as C,ot as D,he as E,rt as F,it as G,Se as H,Ce as I,st as J,at as K,dt as L,ct as M,xe as N,Dt as O,Lt as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as m,h as t}from"./73N3TOJL.js";import{b as E}from"./
|
|
1
|
+
import{e as m,h as t}from"./73N3TOJL.js";import{b as E}from"./CXLEQCP3.js";import{i as C}from"./G6HCV67X.js";import{a as v,b as g}from"./5YS5V2LK.js";import{keccak256 as j,parseAbi as D}from"viem";var A=Object.freeze({robinswapV2:Object.freeze({factory:"0xa95DA9b9fCef09A07F99444fE9304457d6ECdccA",kind:"v2",kyberswap:"robinswap-v2",velora:void 0}),uniswapV2:Object.freeze({factory:"0x8BcEAA40b9aCDfAedf85ADf4fF01f5ad6517937F",kind:"v2",kyberswap:"uniswap",velora:"uniswapv2"}),uniswapV3:Object.freeze({factory:C[4663].uniswap.v3_factory.address,kind:"v3",kyberswap:"uniswapv3",velora:"uniswapv3"})}),L=Object.freeze(Object.fromEntries(Object.entries(A).map(([r,n])=>[r,n.factory])));function V(r){return Object.values(A).flatMap(n=>n[r]??[])}var P=D(["function token0() view returns (address)","function token1() view returns (address)","function factory() view returns (address)","function fee() view returns (uint24)"]),S=D(["function getPair(address,address) view returns (address)","function getPool(address,address,uint24) view returns (address)"]),a=new Map;function M(r,n,i){let d=a.get(j(i));return!!d&&d.expires>Date.now()&&t(d.token,r)&&d.pools.some(u=>t(u,n))}async function B(r,n,i,d,u,z){let w=[...new Set(d.filter(o=>!t(o,u)).map(o=>o.toLowerCase()))];if(!w.length)return;let k=j(z);a.delete(k);let f=await r.getBlockNumber();for(let o of w){let s=e=>new v(`KyberSwap source receiver ${o} is not a verified input pool: ${e}.`),l=Array.isArray(n)?n.map(e=>Array.isArray(e)?e[0]:void 0).find(e=>m(e)&&t(e.pool,o)&&t(e.tokenIn,i)):void 0;if(!m(l)||typeof l.tokenOut!="string")throw s("not named as an input hop in the accepted route");let O=await r.getCode({address:o,blockNumber:f});if(!O||O==="0x")throw s("no deployed code");try{let[e,p,y]=await Promise.all(["token0","token1","factory"].map(c=>r.readContract({address:o,abi:P,functionName:c,blockNumber:f}))),h=t(e,i)?p:t(p,i)?e:void 0;if(!h||!t(h,l.tokenOut))throw s("tokens do not match the input route");let x=Object.values(A).find(c=>t(y,c.factory));if(!x)throw s("factory is not pinned");let b;if(x.kind==="v2")b=await r.readContract({address:y,abi:S,functionName:"getPair",args:[e,p],blockNumber:f});else{let c=await r.readContract({address:o,abi:P,functionName:"fee",blockNumber:f});b=await r.readContract({address:y,abi:S,functionName:"getPool",args:[e,p,c],blockNumber:f})}if(!t(b,o))throw s("not registered by the pinned factory")}catch(e){throw e instanceof v||E(e)?e:g(e,3)?s("pool token or factory read reverted; this pool interface is not supported by Oak"):s("on-chain verification unavailable")}}for(let[o,s]of a)s.expires<=Date.now()&&a.delete(o);a.size>=1e3&&a.delete(a.keys().next().value),a.set(k,{token:i,pools:w,expires:Date.now()+6e4})}export{A as a,L as b,V as c,M as d,B as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as R,e as z,g as V,h as S,k as I,l as k,m as W,n as X,t as E,u as Z,v as J,w as C,x as Q,y as ee,z as $}from"./2EDXKJ3B.js";import{a as h,d as Y}from"./X5V2Z2NM.js";import{a as M}from"./6IM6A5VA.js";import{a as U}from"./UWOFA6GV.js";import{c as _,e as K,g as p,h as G}from"./73N3TOJL.js";import{a as l}from"./5YS5V2LK.js";import{a as B}from"./JXOEJPJ4.js";import{encodeFunctionData as P,hashTypedData as se,parseAbiItem as le,recoverTypedDataAddress as de,decodeFunctionData as ce}from"viem";import{isDeepStrictEqual as pe}from"node:util";var he={AgentWalletSet:[{name:"agentId",type:"uint256"},{name:"newWallet",type:"address"},{name:"owner",type:"address"},{name:"deadline",type:"uint256"}]},we=300n,q=240n,ge="0x1626ba7e";function L(t,c,s,g,v){let{chainId:b,registry:O}=S(t);return{domain:{name:"ERC8004IdentityRegistry",version:"1",chainId:b,verifyingContract:O},types:he,primaryType:"AgentWalletSet",message:{agentId:c.toString(),newWallet:s,owner:g,deadline:v.toString()}}}async function j(t){let c=await t.clientFor(S(t).chainId).getBlock();if(typeof c?.timestamp!="bigint")throw new l("The chain time is unavailable; nothing was built.");return c.timestamp}async function ue(t,c,s,g){try{let H=await de({...c,signature:g});if(p(H,s))return!0}catch{}let v=t.clientFor(S(t).chainId),b=await v.getCode({address:s});if(!b||b==="0x")return!1;let O=se(c);try{return await v.readContract({address:s,abi:Y,functionName:"isValidSignature",args:[O,g]})===ge}catch{return!1}}var te={transactionHash:{...z,description:"After local submission, repeat the same arguments with the mined hash: Oak verifies the exact calldata, the emitted event and the resulting registry state."}},N=(t,c)=>({type:"object",additionalProperties:!1,required:c,properties:{...t,...te}});async function D(t,c){let{chainId:s,registry:g}=S(t),v=await t.clientFor(s).readContract({address:g,abi:h,functionName:"ownerOf",args:[c]});return M(v),v}async function x(t,c,s){let{chainId:g,registry:v}=S(t),b=await t.clientFor(g).readContract({address:v,abi:h,functionName:s,args:[c]});return M(b),b}var Re=t=>{let{chainId:c,registry:s}=S(t),g=(a,r,e)=>({name:a,inputSchema:r,execute:async(n,o)=>{try{return M(o),X(t,n.chainId),await e(n,o)}catch(d){throw new l(t.plainError(d))}}}),v=g("erc8004_wallet_proof",{type:"object",additionalProperties:!1,required:["agentId","newWallet"],description:"Read-only: the exact EIP-712 AgentWalletSet message that newWallet must sign to become the agent's verified payment wallet. Nothing is signed or sent.",properties:{agentId:R,newWallet:{..._,description:"The wallet that will receive payments; it must sign."}}},async a=>{let r=k(a.agentId),e=W(a.newWallet,"newWallet");if(I(e))throw new l("To clear the payment wallet use erc8004_unset_wallet.");let[n,o]=await Promise.all([D(t,r),j(t)]),d=o+q;return{agentId:r.toString(),owner:n,newWallet:e,deadline:d.toString(),validForSeconds:Number(q),chainId:c,registry:s,typedData:L(t,r,e,n,d),next:"Have newWallet sign typedData (EIP-712, eth_signTypedData_v4; an ERC-1271 contract wallet returns its own signature). Never share a key. Then, from the agent owner or an approved operator, call erc8004_set_wallet with the same agentId, newWallet, deadline and the signature as walletSignature before the deadline. If newWallet is the Oak wallet, call erc8004_set_wallet without walletSignature and Oak signs locally.",note:"The owner field is the owner at this moment; a transfer before submission invalidates the signature. The registry rejects a deadline more than 5 minutes ahead."}}),b=g("erc8004_set_wallet",{type:"object",additionalProperties:!1,required:["agentId"],description:"Verify a payment wallet for the agent (setAgentWallet). The new wallet proves control with an EIP-712 signature. Omit walletSignature to sign locally with the Oak wallet when it is the new wallet.",properties:{agentId:R,newWallet:{..._,description:"Defaults to the Oak wallet."},deadline:U("Unix seconds from erc8004_wallet_proof; required with walletSignature."),walletSignature:{...V,description:"newWallet's EIP-712 signature of the erc8004_wallet_proof message."},continuation:{type:"object"},signature:{type:"string",pattern:"^0x([0-9a-fA-F]{2})+$"},...te}},async(a,r)=>{let e=k(a.agentId),n=a.newWallet===void 0?r:W(a.newWallet,"newWallet");if(I(n))throw new l("To clear the payment wallet use erc8004_unset_wallet.");let o=async w=>{let f=C(w,s,h,"MetadataSet"),T=await x(t,e,"getAgentWallet");if(f.metadataKey!=="agentWallet"||!G(f.metadataValue?.toString(),n)||!p(T,n))throw new l("The registry event or current payment wallet does not match the verified wallet.");return{agentId:e.toString(),agentWallet:T,verified:!0,summary:"The payment wallet is now the signed wallet."}},d=w=>{try{let f=ce({abi:h,data:w});return f.functionName==="setAgentWallet"&&f.args[0]===e&&p(f.args[1],n)}catch{return!1}};if(a.transactionHash!==void 0){let w=await J(t,a.transactionHash,r,d,s);return o(w)}let u=async(w,f,T)=>{let F=L(t,e,n,T,w);if(!await ue(t,F,n,f))throw new l("That signature is not a valid signature by newWallet for this exact agent, owner and deadline; nothing was built.");let A=await j(t);if(A>w)throw new l("The wallet proof has expired; request a fresh erc8004_wallet_proof.");if(w>A+we)throw new l("The deadline is more than 5 minutes ahead; the registry would revert. Request a fresh erc8004_wallet_proof.");let ie=P({abi:h,functionName:"setAgentWallet",args:[e,n,w,f]});return $(t,r,{},{to:s,data:ie,description:`Verify ${n} as the payment wallet of ERC-8004 agent ${e}.`,summary:`Sets the verified payment wallet of agent ${e} to ${n} (setAgentWallet; the wallet's own signature was checked locally). The wallet is cleared again by any NFT transfer. The signature expires at ${w}; confirm before then. Repeat the arguments with transactionHash to verify.`,authority:async()=>{},verify:o})};if(a.continuation===void 0){if(a.signature!==void 0)throw new l("A signature needs its continuation; start erc8004_set_wallet again.");let w=await E(t,e,r,"set the payment wallet");if(a.walletSignature!==void 0){if(typeof a.deadline!="string"||!/^[0-9]+$/.test(a.deadline))throw new l("Provide the deadline from erc8004_wallet_proof together with walletSignature.");return u(BigInt(a.deadline),a.walletSignature,w)}if(!p(n,r))throw new l(`The payment wallet must prove control. Call erc8004_wallet_proof for ${n}, have that wallet sign the returned typedData, then call erc8004_set_wallet again with deadline and walletSignature.`);let f=await j(t)+q,T=L(t,e,n,w,f);return{steps:[{kind:"typedData",request:T}],continuation:{stage:"wallet",wallet:r,chainId:c,agentId:e.toString(),newWallet:n,owner:w,deadline:f.toString(),request:T},summary:`Sign locally: the Oak wallet proves control of ${n} so it can become the verified payment wallet of ERC-8004 agent ${e}. It is an EIP-712 message to the agent registry; it moves no funds. Oak then builds the setAgentWallet transaction for confirmation. The proof expires in ${q} seconds.`}}let i=a.continuation;if(!K(i)||i.stage!=="wallet"||i.chainId!==c||typeof i.wallet!="string"||!p(i.wallet,r)||i.agentId!==e.toString()||typeof i.newWallet!="string"||!p(i.newWallet,r)||typeof i.owner!="string"||typeof i.deadline!="string"||!/^[0-9]+$/.test(i.deadline))throw new l("This payment-wallet continuation does not match the wallet, chain and agent; start erc8004_set_wallet again.");if(typeof a.signature!="string")throw new l("Provide this wallet's signature of the payment-wallet proof.");let m=await E(t,e,r,"set the payment wallet");if(!p(m,i.owner))throw new l("The agent changed owner while signing; start erc8004_set_wallet again.");let y=L(t,e,r,m,BigInt(i.deadline));if(!pe(y,i.request))throw new l("The signed request differs from the payment-wallet proof Oak built; nothing was sent.");return u(BigInt(i.deadline),a.signature,m)}),O=g("erc8004_unset_wallet",N({agentId:R},["agentId"]),async(a,r)=>{let e=k(a.agentId),n=P({abi:h,functionName:"unsetAgentWallet",args:[e]});return $(t,r,a,{to:s,data:n,description:`Clear the verified payment wallet of ERC-8004 agent ${e}.`,summary:`Clears the verified payment wallet of agent ${e} (unsetAgentWallet). Payers then have no registry-verified wallet until erc8004_set_wallet proves one. Repeat the arguments with transactionHash to verify.`,authority:()=>E(t,e,r,"clear the payment wallet"),verify:async o=>{let d=C(o,s,h,"MetadataSet"),u=await x(t,e,"getAgentWallet");if(d.metadataKey!=="agentWallet"||d.metadataValue!=="0x"||!I(u))throw new l("The registry event or current payment wallet does not show a cleared wallet.");return{agentId:e.toString(),agentWallet:u,cleared:!0}}})}),H=g("erc8004_transfer",N({agentId:R,to:{..._,description:"The new owner. The agent NFT, its profile and its on-chain history move with it."}},["agentId","to"]),async(a,r)=>{let e=k(a.agentId),n=W(a.to,"recipient");if(I(n)||p(n,s))throw new l("Choose a wallet that can own the agent, not the zero address or the registry.");let o=await D(t,e);if(p(o,n))throw new l("That wallet already owns this agent.");let d=P({abi:h,functionName:"safeTransferFrom",args:[o,n,e]});return $(t,r,a,{to:s,data:d,description:`Transfer ERC-8004 agent ${e} from ${o} to ${n}.`,summary:`Transfers ownership of agent ${e} to ${n} (ERC-721 safeTransferFrom). This clears its verified payment wallet and token approval, ends Oak access linked to the current owner, and the new owner must run oak setup link and re-verify a payment wallet. Operators approved for all agents keep that approval. Repeat the arguments with transactionHash to verify.`,authority:()=>E(t,e,r,"transfer this agent"),verify:async u=>{let i=C(u,s,h,"Transfer"),[m,y]=await Promise.all([D(t,e),x(t,e,"getAgentWallet")]);if(!p(String(i.from),o)||!p(String(i.to),n)||i.tokenId!==e||!p(m,n))throw new l("The registry event or current owner does not match the transfer.");return{agentId:e.toString(),owner:m,previousOwner:o,agentWallet:y,transferred:!0,next:"The new owner links Oak with oak setup link and verifies a payment wallet again."}}})}),ae=g("erc8004_approve",N({agentId:R,operator:{..._,description:"The single address allowed to manage and transfer this one agent."},clear:{type:"boolean",description:"Remove the approval for this agent instead."}},["agentId"]),async(a,r)=>{let e=k(a.agentId),n=a.clear===!0;if(n===(a.operator!==void 0))throw new l("Provide operator to approve, or clear:true to remove the approval, not both.");let o=n?"0x0000000000000000000000000000000000000000":W(a.operator,"operator");if(!n&&I(o))throw new l("Use clear:true to remove an approval.");let d=await D(t,e);if(!n&&p(o,d))throw new l("The owner does not need an approval.");let u=P({abi:h,functionName:"approve",args:[o,e]});return $(t,r,a,{to:s,data:u,description:n?`Remove the approved operator of ERC-8004 agent ${e}.`:`Approve ${o} to manage ERC-8004 agent ${e}.`,summary:n?`Removes the single-agent approval on agent ${e}. Repeat with transactionHash to verify.`:`Lets ${o} update agent ${e}'s profile and metadata, set its payment wallet, request validations for it and TRANSFER it (ERC-721 approve). A transfer or another approve clears it. Repeat with transactionHash to verify.`,authority:()=>Z(t,e,r),verify:async i=>{let m=C(i,s,h,"Approval"),y=await x(t,e,"getApproved");if(m.tokenId!==e||!p(String(m.approved),o)||!p(y,o))throw new l("The registry event or current approval does not match.");return{agentId:e.toString(),approved:I(y)?null:y,owner:m.owner}}})}),ne=g("erc8004_set_operator",N({operator:_,approved:{type:"boolean",description:"true grants, false revokes."}},["operator","approved"]),async(a,r)=>{let e=W(a.operator,"operator");if(typeof a.approved!="boolean")throw new l("approved must be true or false.");if(I(e)||p(e,r))throw new l("Choose another wallet as the operator.");let n=P({abi:h,functionName:"setApprovalForAll",args:[e,a.approved]});return $(t,r,a,{to:s,data:n,description:`${a.approved?"Approve":"Revoke"} ${e} as operator for all this wallet's ERC-8004 agents.`,summary:a.approved?`Gives ${e} control of EVERY ERC-8004 agent this wallet owns now or later: profile and metadata edits, payment wallet, validation requests and TRANSFER of the NFTs (ERC-721 setApprovalForAll). Revoke with approved:false. Repeat with transactionHash to verify.`:`Revokes ${e}'s control of all agents this wallet owns. Repeat with transactionHash to verify.`,authority:async()=>{},verify:async o=>{let d=C(o,s,h,"ApprovalForAll"),u=await t.clientFor(c).readContract({address:s,abi:h,functionName:"isApprovedForAll",args:[r,e]});if(!p(String(d.owner),r)||!p(String(d.operator),e)||d.approved!==a.approved||u!==a.approved)throw new l("The registry event or current operator approval does not match.");return{owner:r,operator:e,approved:u}}})}),re=g("erc8004_set_metadata",N({agentId:R,key:{type:"string",minLength:1,maxLength:128,description:"Onchain metadata key. agentWallet is reserved."},value:{...V,description:"0x hex bytes; provide this or text."},text:{type:"string",description:"UTF-8 text stored as bytes; provide this or value."}},["agentId","key"]),async(a,r)=>{let e=k(a.agentId),n=Q(a.key),o=ee(a),d=P({abi:h,functionName:"setMetadata",args:[e,n,o]});return $(t,r,a,{to:s,data:d,description:`Set onchain metadata ${n} on ERC-8004 agent ${e}.`,summary:`Publishes ${(o.length-2)/2} bytes under the key ${B(n)} on agent ${e}. Onchain metadata is public, mutable and self-asserted. Repeat with transactionHash to verify.`,authority:()=>E(t,e,r,"set metadata"),verify:async u=>{let i=C(u,s,h,"MetadataSet"),m=await t.clientFor(c).readContract({address:s,abi:h,functionName:"getMetadata",args:[e,n]});if(i.agentId!==e||i.metadataKey!==n||i.metadataValue!==o||m!==o)throw new l("The registry event or current metadata does not match.");return{agentId:e.toString(),key:B(n),value:o,confirmed:!0}}})}),oe=g("erc8004_owned",{type:"object",additionalProperties:!1,description:"Read-only: the agent IDs a wallet owns on the registry (it is not enumerable, so this scans incoming Transfer logs and confirms each with ownerOf).",properties:{owner:{..._,description:"Defaults to the Oak wallet."},limit:{type:"integer",minimum:1,maximum:50,default:25}}},async(a,r)=>{let e=a.owner===void 0?r:W(a.owner,"owner"),n=typeof a.limit=="number"?Math.min(Math.max(1,Math.trunc(a.limit)),50):25,o=t.clientFor(c),d=await o.readContract({address:s,abi:h,functionName:"balanceOf",args:[e]});if(typeof d!="bigint")throw new l("Registry balance is unavailable.");if(d===0n)return{owner:e,balance:"0",agents:[],complete:!0};let u=d<BigInt(n)?Number(d):n,i=[],m=new Set,y=await o.getBlockNumber({cacheTime:0});for(let w=0;w<40&&i.length<u;w++){let f=y>9999999n?y-9999999n:0n,T=await o.getLogs({address:s,event:le("event Transfer(address indexed from,address indexed to,uint256 indexed tokenId)"),args:{to:e},fromBlock:f,toBlock:y,strict:!0});for(let F of[...T].reverse()){let A=F.args.tokenId.toString();if(!(F.removed||m.has(A))&&(m.add(A),p(await D(t,BigInt(A)),e)&&i.push(A),i.length>=u))break}if(f===0n)break;y=f-1n}return{owner:e,balance:d.toString(),agents:i,complete:i.length===Number(d),note:i.length<Number(d)?"More agents exist than were listed (limit or scan budget); raise limit or look up a known ID with erc8004_identity.":void 0}});return{tools:[v,b,O,H,ae,ne,re,oe]}};export{we as a,L as b,Re as c};
|
|
1
|
+
import{d as R,e as z,g as V,h as S,k as I,l as k,m as W,n as X,t as E,u as Z,v as J,w as C,x as Q,y as ee,z as $}from"./TWSTOFN3.js";import{a as h,d as Y}from"./X5V2Z2NM.js";import{a as M}from"./6IM6A5VA.js";import{a as U}from"./UWOFA6GV.js";import{c as _,e as K,g as p,h as G}from"./73N3TOJL.js";import{a as l}from"./5YS5V2LK.js";import{a as B}from"./JXOEJPJ4.js";import{encodeFunctionData as P,hashTypedData as se,parseAbiItem as le,recoverTypedDataAddress as de,decodeFunctionData as ce}from"viem";import{isDeepStrictEqual as pe}from"node:util";var he={AgentWalletSet:[{name:"agentId",type:"uint256"},{name:"newWallet",type:"address"},{name:"owner",type:"address"},{name:"deadline",type:"uint256"}]},we=300n,q=240n,ge="0x1626ba7e";function L(t,c,s,g,v){let{chainId:b,registry:O}=S(t);return{domain:{name:"ERC8004IdentityRegistry",version:"1",chainId:b,verifyingContract:O},types:he,primaryType:"AgentWalletSet",message:{agentId:c.toString(),newWallet:s,owner:g,deadline:v.toString()}}}async function j(t){let c=await t.clientFor(S(t).chainId).getBlock();if(typeof c?.timestamp!="bigint")throw new l("The chain time is unavailable; nothing was built.");return c.timestamp}async function ue(t,c,s,g){try{let H=await de({...c,signature:g});if(p(H,s))return!0}catch{}let v=t.clientFor(S(t).chainId),b=await v.getCode({address:s});if(!b||b==="0x")return!1;let O=se(c);try{return await v.readContract({address:s,abi:Y,functionName:"isValidSignature",args:[O,g]})===ge}catch{return!1}}var te={transactionHash:{...z,description:"After local submission, repeat the same arguments with the mined hash: Oak verifies the exact calldata, the emitted event and the resulting registry state."}},N=(t,c)=>({type:"object",additionalProperties:!1,required:c,properties:{...t,...te}});async function D(t,c){let{chainId:s,registry:g}=S(t),v=await t.clientFor(s).readContract({address:g,abi:h,functionName:"ownerOf",args:[c]});return M(v),v}async function x(t,c,s){let{chainId:g,registry:v}=S(t),b=await t.clientFor(g).readContract({address:v,abi:h,functionName:s,args:[c]});return M(b),b}var Re=t=>{let{chainId:c,registry:s}=S(t),g=(a,r,e)=>({name:a,inputSchema:r,execute:async(n,o)=>{try{return M(o),X(t,n.chainId),await e(n,o)}catch(d){throw new l(t.plainError(d))}}}),v=g("erc8004_wallet_proof",{type:"object",additionalProperties:!1,required:["agentId","newWallet"],description:"Read-only: the exact EIP-712 AgentWalletSet message that newWallet must sign to become the agent's verified payment wallet. Nothing is signed or sent.",properties:{agentId:R,newWallet:{..._,description:"The wallet that will receive payments; it must sign."}}},async a=>{let r=k(a.agentId),e=W(a.newWallet,"newWallet");if(I(e))throw new l("To clear the payment wallet use erc8004_unset_wallet.");let[n,o]=await Promise.all([D(t,r),j(t)]),d=o+q;return{agentId:r.toString(),owner:n,newWallet:e,deadline:d.toString(),validForSeconds:Number(q),chainId:c,registry:s,typedData:L(t,r,e,n,d),next:"Have newWallet sign typedData (EIP-712, eth_signTypedData_v4; an ERC-1271 contract wallet returns its own signature). Never share a key. Then, from the agent owner or an approved operator, call erc8004_set_wallet with the same agentId, newWallet, deadline and the signature as walletSignature before the deadline. If newWallet is the Oak wallet, call erc8004_set_wallet without walletSignature and Oak signs locally.",note:"The owner field is the owner at this moment; a transfer before submission invalidates the signature. The registry rejects a deadline more than 5 minutes ahead."}}),b=g("erc8004_set_wallet",{type:"object",additionalProperties:!1,required:["agentId"],description:"Verify a payment wallet for the agent (setAgentWallet). The new wallet proves control with an EIP-712 signature. Omit walletSignature to sign locally with the Oak wallet when it is the new wallet.",properties:{agentId:R,newWallet:{..._,description:"Defaults to the Oak wallet."},deadline:U("Unix seconds from erc8004_wallet_proof; required with walletSignature."),walletSignature:{...V,description:"newWallet's EIP-712 signature of the erc8004_wallet_proof message."},continuation:{type:"object"},signature:{type:"string",pattern:"^0x([0-9a-fA-F]{2})+$"},...te}},async(a,r)=>{let e=k(a.agentId),n=a.newWallet===void 0?r:W(a.newWallet,"newWallet");if(I(n))throw new l("To clear the payment wallet use erc8004_unset_wallet.");let o=async w=>{let f=C(w,s,h,"MetadataSet"),T=await x(t,e,"getAgentWallet");if(f.metadataKey!=="agentWallet"||!G(f.metadataValue?.toString(),n)||!p(T,n))throw new l("The registry event or current payment wallet does not match the verified wallet.");return{agentId:e.toString(),agentWallet:T,verified:!0,summary:"The payment wallet is now the signed wallet."}},d=w=>{try{let f=ce({abi:h,data:w});return f.functionName==="setAgentWallet"&&f.args[0]===e&&p(f.args[1],n)}catch{return!1}};if(a.transactionHash!==void 0){let w=await J(t,a.transactionHash,r,d,s);return o(w)}let u=async(w,f,T)=>{let F=L(t,e,n,T,w);if(!await ue(t,F,n,f))throw new l("That signature is not a valid signature by newWallet for this exact agent, owner and deadline; nothing was built.");let A=await j(t);if(A>w)throw new l("The wallet proof has expired; request a fresh erc8004_wallet_proof.");if(w>A+we)throw new l("The deadline is more than 5 minutes ahead; the registry would revert. Request a fresh erc8004_wallet_proof.");let ie=P({abi:h,functionName:"setAgentWallet",args:[e,n,w,f]});return $(t,r,{},{to:s,data:ie,description:`Verify ${n} as the payment wallet of ERC-8004 agent ${e}.`,summary:`Sets the verified payment wallet of agent ${e} to ${n} (setAgentWallet; the wallet's own signature was checked locally). The wallet is cleared again by any NFT transfer. The signature expires at ${w}; confirm before then. Repeat the arguments with transactionHash to verify.`,authority:async()=>{},verify:o})};if(a.continuation===void 0){if(a.signature!==void 0)throw new l("A signature needs its continuation; start erc8004_set_wallet again.");let w=await E(t,e,r,"set the payment wallet");if(a.walletSignature!==void 0){if(typeof a.deadline!="string"||!/^[0-9]+$/.test(a.deadline))throw new l("Provide the deadline from erc8004_wallet_proof together with walletSignature.");return u(BigInt(a.deadline),a.walletSignature,w)}if(!p(n,r))throw new l(`The payment wallet must prove control. Call erc8004_wallet_proof for ${n}, have that wallet sign the returned typedData, then call erc8004_set_wallet again with deadline and walletSignature.`);let f=await j(t)+q,T=L(t,e,n,w,f);return{steps:[{kind:"typedData",request:T}],continuation:{stage:"wallet",wallet:r,chainId:c,agentId:e.toString(),newWallet:n,owner:w,deadline:f.toString(),request:T},summary:`Sign locally: the Oak wallet proves control of ${n} so it can become the verified payment wallet of ERC-8004 agent ${e}. It is an EIP-712 message to the agent registry; it moves no funds. Oak then builds the setAgentWallet transaction for confirmation. The proof expires in ${q} seconds.`}}let i=a.continuation;if(!K(i)||i.stage!=="wallet"||i.chainId!==c||typeof i.wallet!="string"||!p(i.wallet,r)||i.agentId!==e.toString()||typeof i.newWallet!="string"||!p(i.newWallet,r)||typeof i.owner!="string"||typeof i.deadline!="string"||!/^[0-9]+$/.test(i.deadline))throw new l("This payment-wallet continuation does not match the wallet, chain and agent; start erc8004_set_wallet again.");if(typeof a.signature!="string")throw new l("Provide this wallet's signature of the payment-wallet proof.");let m=await E(t,e,r,"set the payment wallet");if(!p(m,i.owner))throw new l("The agent changed owner while signing; start erc8004_set_wallet again.");let y=L(t,e,r,m,BigInt(i.deadline));if(!pe(y,i.request))throw new l("The signed request differs from the payment-wallet proof Oak built; nothing was sent.");return u(BigInt(i.deadline),a.signature,m)}),O=g("erc8004_unset_wallet",N({agentId:R},["agentId"]),async(a,r)=>{let e=k(a.agentId),n=P({abi:h,functionName:"unsetAgentWallet",args:[e]});return $(t,r,a,{to:s,data:n,description:`Clear the verified payment wallet of ERC-8004 agent ${e}.`,summary:`Clears the verified payment wallet of agent ${e} (unsetAgentWallet). Payers then have no registry-verified wallet until erc8004_set_wallet proves one. Repeat the arguments with transactionHash to verify.`,authority:()=>E(t,e,r,"clear the payment wallet"),verify:async o=>{let d=C(o,s,h,"MetadataSet"),u=await x(t,e,"getAgentWallet");if(d.metadataKey!=="agentWallet"||d.metadataValue!=="0x"||!I(u))throw new l("The registry event or current payment wallet does not show a cleared wallet.");return{agentId:e.toString(),agentWallet:u,cleared:!0}}})}),H=g("erc8004_transfer",N({agentId:R,to:{..._,description:"The new owner. The agent NFT, its profile and its on-chain history move with it."}},["agentId","to"]),async(a,r)=>{let e=k(a.agentId),n=W(a.to,"recipient");if(I(n)||p(n,s))throw new l("Choose a wallet that can own the agent, not the zero address or the registry.");let o=await D(t,e);if(p(o,n))throw new l("That wallet already owns this agent.");let d=P({abi:h,functionName:"safeTransferFrom",args:[o,n,e]});return $(t,r,a,{to:s,data:d,description:`Transfer ERC-8004 agent ${e} from ${o} to ${n}.`,summary:`Transfers ownership of agent ${e} to ${n} (ERC-721 safeTransferFrom). This clears its verified payment wallet and token approval, ends Oak access linked to the current owner, and the new owner must run oak setup link and re-verify a payment wallet. Operators approved for all agents keep that approval. Repeat the arguments with transactionHash to verify.`,authority:()=>E(t,e,r,"transfer this agent"),verify:async u=>{let i=C(u,s,h,"Transfer"),[m,y]=await Promise.all([D(t,e),x(t,e,"getAgentWallet")]);if(!p(String(i.from),o)||!p(String(i.to),n)||i.tokenId!==e||!p(m,n))throw new l("The registry event or current owner does not match the transfer.");return{agentId:e.toString(),owner:m,previousOwner:o,agentWallet:y,transferred:!0,next:"The new owner links Oak with oak setup link and verifies a payment wallet again."}}})}),ae=g("erc8004_approve",N({agentId:R,operator:{..._,description:"The single address allowed to manage and transfer this one agent."},clear:{type:"boolean",description:"Remove the approval for this agent instead."}},["agentId"]),async(a,r)=>{let e=k(a.agentId),n=a.clear===!0;if(n===(a.operator!==void 0))throw new l("Provide operator to approve, or clear:true to remove the approval, not both.");let o=n?"0x0000000000000000000000000000000000000000":W(a.operator,"operator");if(!n&&I(o))throw new l("Use clear:true to remove an approval.");let d=await D(t,e);if(!n&&p(o,d))throw new l("The owner does not need an approval.");let u=P({abi:h,functionName:"approve",args:[o,e]});return $(t,r,a,{to:s,data:u,description:n?`Remove the approved operator of ERC-8004 agent ${e}.`:`Approve ${o} to manage ERC-8004 agent ${e}.`,summary:n?`Removes the single-agent approval on agent ${e}. Repeat with transactionHash to verify.`:`Lets ${o} update agent ${e}'s profile and metadata, set its payment wallet, request validations for it and TRANSFER it (ERC-721 approve). A transfer or another approve clears it. Repeat with transactionHash to verify.`,authority:()=>Z(t,e,r),verify:async i=>{let m=C(i,s,h,"Approval"),y=await x(t,e,"getApproved");if(m.tokenId!==e||!p(String(m.approved),o)||!p(y,o))throw new l("The registry event or current approval does not match.");return{agentId:e.toString(),approved:I(y)?null:y,owner:m.owner}}})}),ne=g("erc8004_set_operator",N({operator:_,approved:{type:"boolean",description:"true grants, false revokes."}},["operator","approved"]),async(a,r)=>{let e=W(a.operator,"operator");if(typeof a.approved!="boolean")throw new l("approved must be true or false.");if(I(e)||p(e,r))throw new l("Choose another wallet as the operator.");let n=P({abi:h,functionName:"setApprovalForAll",args:[e,a.approved]});return $(t,r,a,{to:s,data:n,description:`${a.approved?"Approve":"Revoke"} ${e} as operator for all this wallet's ERC-8004 agents.`,summary:a.approved?`Gives ${e} control of EVERY ERC-8004 agent this wallet owns now or later: profile and metadata edits, payment wallet, validation requests and TRANSFER of the NFTs (ERC-721 setApprovalForAll). Revoke with approved:false. Repeat with transactionHash to verify.`:`Revokes ${e}'s control of all agents this wallet owns. Repeat with transactionHash to verify.`,authority:async()=>{},verify:async o=>{let d=C(o,s,h,"ApprovalForAll"),u=await t.clientFor(c).readContract({address:s,abi:h,functionName:"isApprovedForAll",args:[r,e]});if(!p(String(d.owner),r)||!p(String(d.operator),e)||d.approved!==a.approved||u!==a.approved)throw new l("The registry event or current operator approval does not match.");return{owner:r,operator:e,approved:u}}})}),re=g("erc8004_set_metadata",N({agentId:R,key:{type:"string",minLength:1,maxLength:128,description:"Onchain metadata key. agentWallet is reserved."},value:{...V,description:"0x hex bytes; provide this or text."},text:{type:"string",description:"UTF-8 text stored as bytes; provide this or value."}},["agentId","key"]),async(a,r)=>{let e=k(a.agentId),n=Q(a.key),o=ee(a),d=P({abi:h,functionName:"setMetadata",args:[e,n,o]});return $(t,r,a,{to:s,data:d,description:`Set onchain metadata ${n} on ERC-8004 agent ${e}.`,summary:`Publishes ${(o.length-2)/2} bytes under the key ${B(n)} on agent ${e}. Onchain metadata is public, mutable and self-asserted. Repeat with transactionHash to verify.`,authority:()=>E(t,e,r,"set metadata"),verify:async u=>{let i=C(u,s,h,"MetadataSet"),m=await t.clientFor(c).readContract({address:s,abi:h,functionName:"getMetadata",args:[e,n]});if(i.agentId!==e||i.metadataKey!==n||i.metadataValue!==o||m!==o)throw new l("The registry event or current metadata does not match.");return{agentId:e.toString(),key:B(n),value:o,confirmed:!0}}})}),oe=g("erc8004_owned",{type:"object",additionalProperties:!1,description:"Read-only: the agent IDs a wallet owns on the registry (it is not enumerable, so this scans incoming Transfer logs and confirms each with ownerOf).",properties:{owner:{..._,description:"Defaults to the Oak wallet."},limit:{type:"integer",minimum:1,maximum:50,default:25}}},async(a,r)=>{let e=a.owner===void 0?r:W(a.owner,"owner"),n=typeof a.limit=="number"?Math.min(Math.max(1,Math.trunc(a.limit)),50):25,o=t.clientFor(c),d=await o.readContract({address:s,abi:h,functionName:"balanceOf",args:[e]});if(typeof d!="bigint")throw new l("Registry balance is unavailable.");if(d===0n)return{owner:e,balance:"0",agents:[],complete:!0};let u=d<BigInt(n)?Number(d):n,i=[],m=new Set,y=await o.getBlockNumber({cacheTime:0});for(let w=0;w<40&&i.length<u;w++){let f=y>9999999n?y-9999999n:0n,T=await o.getLogs({address:s,event:le("event Transfer(address indexed from,address indexed to,uint256 indexed tokenId)"),args:{to:e},fromBlock:f,toBlock:y,strict:!0});for(let F of[...T].reverse()){let A=F.args.tokenId.toString();if(!(F.removed||m.has(A))&&(m.add(A),p(await D(t,BigInt(A)),e)&&i.push(A),i.length>=u))break}if(f===0n)break;y=f-1n}return{owner:e,balance:d.toString(),agents:i,complete:i.length===Number(d),note:i.length<Number(d)?"More agents exist than were listed (limit or scan budget); raise limit or look up a known ID with erc8004_identity.":void 0}});return{tools:[v,b,O,H,ae,ne,re,oe]}};export{we as a,L as b,Re as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b as o,d as r}from"./
|
|
1
|
+
import{a,b as o,d as r}from"./V5LTA42G.js";import{c as s}from"./GGUEKSR4.js";import{a as t}from"./G6HCV67X.js";var i=[{feature:"Ethos claim",source:"https://go.priors.trade/start-ethos.js",missing:"Public claim endpoint signs/sends the sponsor transaction remotely. No unsigned final transaction with a local preview/confirmation handoff is published. Use the owner Go Start workflow; Oak offers status and route discovery."},{feature:"x402 pay_url, paid reports, hire payments and pay_gateway",source:"https://github.com/priors-agents/priors/tree/02230282d8888e00794207ed271ee01b4ce30309/packages/x402",missing:"These hand EIP-3009 payment authorization to an external merchant/facilitator. The recipient settles remotely; no Oak-local unsigned transaction handoff is exposed. Oak discovery is supported; external payment-signature validation, recipient/invoice binding and preview semantics require a shared add-on protocol, beyond this module write scope. Gateway source also says its live 402 surface was not measured."},{feature:"Go Google/Privy account, gas sponsorship, recovery and agent001 approvals",source:"https://go.priors.trade/account",missing:"Authenticated smart-account/session and sponsored-operation APIs are not publicly specified as an unsigned plain-wallet contract. Owner uses Priors UI. Underlying pool, stock, savings and backing contracts are supported here."},{feature:"Publish merchant listings, job offers/results, board requests and signed public offers",source:"https://priors.trade/agent",missing:"Hosted MCP supplies discovery and signed board reads. A versioned authenticated mutation/withdrawal contract is not pinned from the inspected public SDK. Existing owner consent plus direct sponsor offer is supported on chain; creating external listings/messages remains an owner workflow."},{feature:"Create the X proof post",source:"https://go.priors.trade/xlink-core.js",missing:"Requires the human account owner to publish on X. Oak can set or clear the canonical proof URL as public ERC-8004 metadata, but does not publish posts or claim metadata alone verifies X ownership."}];function p(){return{tools:[{name:"priors_capabilities",inputSchema:{type:"object",properties:{},additionalProperties:!1},async execute(){return{chainId:t,sourceCommit:"02230282d8888e00794207ed271ee01b4ce30309",reads:[...a],actions:[...r],localOwnerSignatures:[...o],ownerOnly:s.filter(e=>e.owner).map(e=>e.name),blocked:i.map(e=>({...e,status:"BLOCKED"})),integration:"The shared bridge/server diffs must be integrated for open reads, local signing continuations, exact calldata reconstruction, action destinations and human confirmation. New core builders fail closed in older add-ons; a core-only install does not establish end-to-end feature availability.",safety:"Every local action previews its exact unsigned transaction bundle. Approvals equal inputs or explicit finite future budgets; never unlimited. Persistent autopay and bids authorize later third-party execution within the stated budget. Token backing is collateral and provides no promised returns."}}}]}}export{i as a,p as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g}from"./X5V2Z2NM.js";import{a as m}from"./6IM6A5VA.js";import{a as v}from"./UWOFA6GV.js";import{e as A,g as u,i as b}from"./73N3TOJL.js";import{a as l,i as x,s as y}from"./
|
|
1
|
+
import{a as g}from"./X5V2Z2NM.js";import{a as m}from"./6IM6A5VA.js";import{a as v}from"./UWOFA6GV.js";import{e as A,g as u,i as b}from"./73N3TOJL.js";import{a as l,i as x,s as y}from"./G6HCV67X.js";import{a as o}from"./5YS5V2LK.js";import{b as w}from"./JXOEJPJ4.js";import{Buffer as k}from"node:buffer";import{decodeEventLog as $}from"viem";var R="Profile contents and oak.registrar are mutable, self-asserted metadata, not registry-validated claims or proof of provenance.",B="oak.registrar",D="0x6f616b",L=v("Agent ID as a decimal uint256 integer string."),j={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},q={type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:"32-byte hex value."},z={type:"string",pattern:"^0x([0-9a-fA-F]{2})*$"},T="0x0000000000000000000000000000000000000000";function h(t){let e=t.network??"mainnet",{chainId:n,identityRegistry:r}=y[e],s=e==="mainnet"?x[l].identity:void 0;return{network:e,chainId:n,registry:r,registryId:`eip155:${n}:${r}`,reputation:s?.reputationRegistry.address,validation:s?.validationRegistry.address}}function K(t){let{chainId:e,reputation:n}=h(t);if(!n)throw new o("Oak has no pinned ERC-8004 reputation registry for this network.");return{chainId:e,address:n}}function V(t){let{chainId:e,validation:n}=h(t);if(!n)throw new o("Oak has no pinned ERC-8004 validation registry for this network.");return{chainId:e,address:n}}function Z(t){return u(t,T)}function G(t){if(typeof t!="string"||!/^[0-9]+$/.test(t)||t.length>78||BigInt(t)>=2n**256n)throw new o("Provide an agent ID as a decimal uint256 integer string.");return BigInt(t)}function J(t,e){return b(t,`Provide a valid ${e} address.`)}function Q(t,e){let n=h(t).chainId;if(e!==void 0&&e!==n)throw new o(`ERC-8004 actions are supported only on chain ${n}.`)}function X(t,e){if(typeof t!="string"||!/^0x[0-9a-fA-F]{64}$/.test(t))throw new o(`Provide ${e} as 32-byte hex.`);return t.toLowerCase()}function I(t,e,n,r=!0){if(t===void 0){if(r)return"";throw new o(`Provide ${e}.`)}if(typeof t!="string"||!r&&!t.trim()||t.length>n||w(t))throw new o(`${e} must be plain text of at most ${n} characters.`);return t}function Y(t,e){if(typeof t!="string"||!t.trim()||t.length>2048)throw new o(`Provide a valid ${e}.`);try{let n=new URL(t);if(!["https:","ipfs:"].includes(n.protocol)||!n.hostname||n.username||n.password||w(t))throw new Error}catch{throw new o(`${e} must be an HTTPS or IPFS URI without credentials.`)}return t}function tt(t){let e=/^data:application\/json;base64,([A-Za-z0-9+/=]+)$/.exec(t);if(e)try{let n=JSON.parse(k.from(e[1],"base64").toString("utf8"));return A(n)?n:void 0}catch{return}}async function C(t,e,n,r,s=!0){let i=await t.preview(e,n),a=i.changes.map(({amount:d,token:f})=>{let c=d.startsWith("-");return`${c?"-":""}${t.formatAmount(c?d.slice(1):d,f.decimals)} ${f.symbol} (${f.address}, chain ${f.chainId})`});return{txs:e,summary:`${i.summary} ${a.join("; ")} ${s?`${R} `:""}${r}`}}async function et(t,e,n,r="update this profile"){let{chainId:s,registry:i}=h(t),a=t.clientFor(s),d=await a.readContract({address:i,abi:g,functionName:"ownerOf",args:[e]});if(m(d),u(d,n))return d;let[f,c]=await Promise.all([a.readContract({address:i,abi:g,functionName:"getApproved",args:[e]}),a.readContract({address:i,abi:g,functionName:"isApprovedForAll",args:[d,n]})]);if(m(f),typeof c!="boolean")throw new o("The registry returned invalid operator approval data.");if(!u(f,n)&&!c)throw new o(`Only the agent owner or an approved operator can ${r}.`);return d}async function nt(t,e,n){let{chainId:r,registry:s}=h(t),i=t.clientFor(r),a=await i.readContract({address:s,abi:g,functionName:"ownerOf",args:[e]});if(m(a),u(a,n))return a;if(await i.readContract({address:s,abi:g,functionName:"isApprovedForAll",args:[a,n]})!==!0)throw new o("Only the agent owner or an operator approved for all of its agents can change the token approval.");return a}async function H(t,e,n,r,s){let{chainId:i,registry:a}=h(t),d=s??a;if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e))throw new o("Provide the mined transaction hash.");let f=t.clientFor(i),c=await f.getTransactionReceipt({hash:e});if(!c)throw new o("The transaction is not mined yet. Try again after confirmation.");if(c.status!=="success"||!c.to||!u(c.to,d)||!u(c.from,n)||!u(c.transactionHash,e))throw new o("The receipt is not a successful matching registry transaction.");let p=await f.getTransaction({hash:e});if(p.chainId!==i||p.value!==0n||!p.to||!u(p.to,d)||!u(p.from,n))throw new o("The transaction does not match this chain, registry and wallet.");if(!(typeof r=="function"?typeof p.input=="string"&&r(p.input):typeof p.input=="string"&&u(p.input,r)))throw new o("The mined transaction calldata does not match the exact operation Oak built.");return c}function rt(t,e,n,r){let s=t.logs.filter(i=>u(i.address,e)&&!i.removed).flatMap(i=>{try{let a=$({abi:n,topics:i.topics,data:i.data,strict:!0});return a.eventName===r?[a.args]:[]}catch{return[]}});if(s.length!==1)throw new o(`The receipt must contain one matching ${r} event.`);return s[0]}function ot(t){let e=I(t,"metadata key",128,!1);if(e==="agentWallet")throw new o("The key agentWallet is reserved: use erc8004_set_wallet / erc8004_unset_wallet, which prove control of the wallet.");return e}function it(t){if(t.value===void 0==(t.text===void 0))throw new o("Provide exactly one of value (0x hex bytes) or text (UTF-8).");let e;if(t.value!==void 0){if(typeof t.value!="string"||!/^0x([0-9a-fA-F]{2})*$/.test(t.value))throw new o("Metadata value must be 0x-prefixed hex bytes.");e=t.value}else{if(typeof t.text!="string")throw new o("Metadata text must be a string.");e=`0x${k.from(t.text,"utf8").toString("hex")}`}if((e.length-2)/2>4096)throw new o("Metadata values are limited to 4096 bytes.");return e}async function at(t,e,n,r){let{chainId:s}=h(t);if(n.transactionHash!==void 0){let a=await H(t,n.transactionHash,e,r.matcher??r.data,r.to);return r.verify(a)}await r.authority();let i=t.unsignedTx({to:r.to,data:r.data,value:"0",chainId:s,description:r.description});return C(t,[i],e,r.summary,!1)}export{R as a,B as b,D as c,L as d,j as e,q as f,z as g,h,K as i,V as j,Z as k,G as l,J as m,Q as n,X as o,I as p,Y as q,tt as r,C as s,et as t,nt as u,H as v,rt as w,ot as x,it as y,at as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Q}from"./
|
|
1
|
+
import{a as X}from"./CEQNXF6A.js";import{b as Q}from"./PZHR4ITH.js";import{a as O,b as J,d as V}from"./DCTUYDWF.js";import{a as E}from"./QYKXWBZC.js";import{K as y}from"./L3ZM77SJ.js";import{c as S}from"./JPOYTTTW.js";import{a as H}from"./6IM6A5VA.js";import{a as N}from"./UWOFA6GV.js";import{d as G,g as U,i as K}from"./73N3TOJL.js";import{a as b}from"./G6HCV67X.js";import{a as e}from"./5YS5V2LK.js";import{encodeFunctionData as Z,erc20Abi as Y,getAddress as W,parseAbi as ee,zeroAddress as te}from"viem";var v={address:W("0xCeF73866b088766DeD46Ba71d9Bd7591B5e931d2"),symbol:"tNET",decimals:9,chainId:b},_={pair_oracle:["checkpoint"],futures:["open","close","marginCall","accrueCarry","sweepCarrySkim"],underwriting:["subscribe","redeem"],prize:["enter","enterWithNet","exit","exitToUsdg","lockTranche","earlyUnlock","pokeRebase"]},fe=x=>({tools:[{name:"netnet_desk_action",inputSchema:{type:"object",additionalProperties:!1,required:["program","operation"],properties:{program:{type:"string",enum:Object.keys(_)},operation:{type:"string",enum:[...new Set(Object.values(_).flat())]},amount:N(),minAmountOut:N(),maxPayment:N(),sizeUsdWad:N(),isLong:{type:"boolean"},account:{type:"string"},referrer:{type:"string"},trancheIndex:N(),lockDraws:{enum:["7","30"]},maxPenaltyAssets:N()}},execute:async(t,l)=>{try{if(H(l),typeof t.program!="string"||!Object.hasOwn(_,t.program)||typeof t.operation!="string"||!_[t.program].includes(t.operation))throw new e("Choose a supported finite NetNet desk operation.");let p=t.program,r=t.operation,P=E[p],q=X[p],T=x.clientFor(b);if(await T.getChainId()!==b)throw new e("NetNet desk actions require chain 4663.");let C=await T.getBlock(),z=new Set(["program","operation"]),m=(n,s=[])=>T.readContract({address:P.address,abi:q,functionName:n,args:s,blockNumber:C.number}),h=(...n)=>n.forEach(s=>z.add(s)),A=()=>(h("amount"),y(t.amount)),D=()=>(h("minAmountOut"),y(t.minAmountOut)),c=n=>K(n,"Provide an explicit checksummed account.",G),u=[],o,d=0n,w="",g;if(p==="pair_oracle"){if(c(await m("pairContract"))!==Q)throw new e("The oracle does not use the pinned canonical pair.");w="Permissionless oracle checkpoint; it sends no reward to this wallet and may not yet produce a valid TWAP."}else if(p==="futures"||p==="underwriting"){if(c(await m("token"))!==v.address||await T.readContract({address:v.address,abi:Y,functionName:"decimals",blockNumber:C.number})!==9)throw new e("This desk does not use the pinned valueless 9-decimal tNET test collateral.");let n=E.futures.address,s=E.underwriting.address;if(p==="futures"?c(await m("vault"))!==s:c(await m("clearinghouse"))!==n)throw new e("Futures and underwriting counterparties do not match the published pins.");if(w="Experimental tNET test program; tNET has no monetary value. Futures margin and underwriting capital can be lost. Utilization/ADL can prevent redemption. Prices and fees are read from the contract oracle; these calls encode no price floor.",r==="open"){if(h("isLong","sizeUsdWad","maxPayment"),typeof t.isLong!="boolean")throw new e("Provide isLong as a boolean.");let a=A(),f=y(t.sizeUsdWad);if(a>=1n<<128n||f>=1n<<128n)throw new e("Position margin and notional must fit uint128.");let k=c(await m("oracle"));if(k!==W("0xc8a11E8793F8714a159061369173dc86A0A5E23F"))throw new e("The futures oracle is not the published deployment.");let $=await T.readContract({address:k,abi:ee(["function marginPriceWad() view returns (uint256)"]),functionName:"marginPriceWad",blockNumber:C.number});if($<=0n)throw new e("Futures margin price is unavailable.");let i=f*5n/10000n*1000000000n/$;if(d=a+i,o=v,d>y(t.maxPayment))throw new e("Margin plus taker fee exceeds maxPayment.");u=[t.isLong,f,a],w+=` Entry fee ${i} tNET base units; exact approval caps price drift and may require a fresh preview.`}else if(r==="marginCall"){h("account");let a=c(t.account);if(await m("liquidatable",[a])!==!0)throw new e("The selected futures trader is not liquidatable.");u=[a]}else if(r==="subscribe"){d=A(),o=v,u=[d];let[a,f]=await Promise.all([m("totalShares"),m("equityTokens")]);if(typeof a!="bigint"||typeof f!="bigint"||a>0n&&f===0n)throw new e("Underwriting share price is invalid.");let k=a===0n?d:d*a/f;if(k===0n||k<D())throw new e("Underwriting subscription rounds to zero or misses the local share minimum.");w+=` Current quote ${k} underwriting share units; the share minimum is a local check, not encoded calldata.`}else if(r==="redeem"){let a=A();if(a>await m("sharesOf",[l]))throw new e("The wallet has insufficient underwriting shares.");u=[a],g={token:v,amount:D()}}}else{let[n,s,a,f,k,$]=await Promise.all(["net","usdg","staking","sNet","controller","book"].map(i=>m(i)));if(c(n)!==O.address||c(s)!==S.address||c(a)!==V||c(f)!==J.address||c(k)!==E.draw.address||c($)!==E.bonus.address)throw new e("WinNET token, staking, book or controller does not match its published pins.");if(w="WinNET principal is a fixed NET claim, exposed to NET price changes. Entry commits through three staking epochs; locks commit for 7 or 30 draws. Early unlock forfeits 1% of principal and cancels streak credits. Pair buys and sells each incur the NET trading tax; no prize or return is guaranteed.",r==="enter"||r==="enterWithNet"){h("referrer");let i=t.referrer===void 0?te:c(t.referrer);if(i===W(l))throw new e("WinNET does not permit self-referral.");d=A(),o=r==="enter"?S:O,u=r==="enter"?[d,D(),i]:[d,i],w+=` Referrer ${i} is recorded at the first deposit and cannot later be changed.`}else if(r==="exit"||r==="exitToUsdg"){let i=A();if(i>await m("principalOf",[l]))throw new e("WinNET exit exceeds this wallet\u2019s fixed principal.");u=r==="exit"?[i,l]:[i,D(),l],g={token:r==="exit"?O:S,amount:r==="exit"?i:y(t.minAmountOut)}}else if(r==="lockTranche"||r==="earlyUnlock"){h("trancheIndex");let i=y(t.trancheIndex,!0),I=await m("trancheAt",[l,i]);if(!Array.isArray(I)||typeof I[0]!="bigint"||I[0]===0n)throw new e("Choose a nonempty WinNET tranche.");if(r==="lockTranche"){if(h("lockDraws"),t.lockDraws!=="7"&&t.lockDraws!=="30")throw new e("Choose a 7- or 30-draw lock.");u=[i,BigInt(t.lockDraws)]}else{h("maxPenaltyAssets");let M=(I[0]+99n)/100n;if(M>y(t.maxPenaltyAssets,!0))throw new e("Early unlock exceeds maxPenaltyAssets in NET base units.");u=[i],w+=` Current irreversible forfeiture ${M} NET base units.`}}}if(Object.keys(t).some(n=>!z.has(n)))throw new e("Unexpected fields for this desk operation.");if(o&&await T.readContract({address:o.address,abi:Y,functionName:"balanceOf",args:[l],blockNumber:C.number})<d)throw new e(`Top up ${o.symbol}; this action needs ${d} base units.`);let F=`NetNet ${p}.${r}, contract ${P.address}, chain ${b}, ordered values ${JSON.stringify(u,(n,s)=>typeof s=="bigint"?String(s):s)}. ${o?`Approve exactly ${d} ${o.symbol} base units (token ${o.address}, decimals ${o.decimals}). `:""}${w}`,L=[...o?[x.approval(o.address,P.address,d.toString(),b)]:[],x.unsignedTx({to:P.address,data:Z({abi:q,functionName:r,args:u}),value:"0",chainId:b,description:F})],R=await x.preview(L,l),B=0n,j=0n;for(let n of R.changes){if(n.token.chainId!==b||!/^-?\d+$/.test(n.amount))throw new e("Invalid desk preview metadata.");let s=BigInt(n.amount);if(s<0n){if(!o||!U(n.token.address,o.address)||n.token.decimals!==o.decimals)throw new e("Desk preview spends an unexpected wallet asset.");B-=s}if(g&&U(n.token.address,g.token.address)){if(n.token.decimals!==g.token.decimals)throw new e("Desk receipt decimals mismatch.");j+=s}}if(B>d||g&&j<g.amount)throw new e("Desk preview exceeds its input budget or misses the requested receipt minimum.");return{txs:L,preview:R,summary:F}}catch(p){throw new e(x.plainError(p))}}}]});export{v as a,fe as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as K,c as U}from"./CUNQ5RG5.js";import{L as z}from"./L3ZM77SJ.js";import{a as T}from"./6UPPUHCL.js";import{c as N}from"./TCPPYBGQ.js";import{c as F,f as R,g as L,h as H,i as W}from"./AMICUXS6.js";import{a as M}from"./6IM6A5VA.js";import{a as u}from"./UWOFA6GV.js";import{g as I}from"./73N3TOJL.js";import{a as y}from"./G6HCV67X.js";import{a as o}from"./5YS5V2LK.js";import{encodeFunctionData as P,erc20Abi as j,getAddress as q,parseAbi as k}from"viem";var w=k(["function asset() view returns (address)","function decimals() view returns (uint8)","function balanceOf(address) view returns (uint256)","function previewMint(uint256) view returns (uint256)","function previewRedeem(uint256) view returns (uint256)","function previewWithdraw(uint256) view returns (uint256)","function mint(uint256 shares,address receiver) returns (uint256)","function redeem(uint256 shares,address receiver,address owner) returns (uint256)","function withdraw(uint256 assets,address receiver,address owner) returns (uint256)"]);function S(t,i=!1){if(typeof t!="string"||!/^\d+$/.test(t)||t.length>78||BigInt(t)>=1n<<256n||!i&&BigInt(t)===0n)throw new o("Provide a positive uint256 decimal base-unit string.");return BigInt(t)}function le(t,i,g){return["details","analytics","manage","mint",i==="netnet"?"redeem":"withdraw_assets","force_exit","in_kind_exit"].map(e=>{let $=[...i==="longbow"?["vault"]:[],...e==="mint"?["shares","maxAssets"]:e==="redeem"?["shares"]:e==="withdraw_assets"?["amount"]:e==="force_exit"?["maxPenaltyAssets","minAmountOut"]:[]],m={...i==="longbow"?{vault:{type:"string",enum:g.map(s=>s.vault)}}:{}};e==="in_kind_exit"&&(Object.assign(m,{amount:u(),maxShares:u(),maxPenaltyAssets:u(),deadline:u()}),$.push("amount","maxShares","maxPenaltyAssets","deadline")),e==="mint"&&Object.assign(m,{shares:u(),maxAssets:u()}),e==="redeem"&&(m.shares=u()),e==="withdraw_assets"&&(m.amount=u()),e==="force_exit"&&Object.assign(m,{maxPenaltyAssets:u(),minAmountOut:u()});let G=N(t,`${i}_manage`,g[0].vault,g[0].asset),J=T(t,`${i}_analytics`,g[0].vault);if(e==="manage"||e==="analytics"){let s=e==="manage"?G.inputSchema:J.inputSchema;Object.assign(m,s.properties),e==="analytics"&&i==="longbow"&&(m.view={type:"string",enum:["apy","published_apy","allocations","history","pending_governance"]}),$.push(...s.required)}return{name:`${i}_${e}`,inputSchema:{type:"object",properties:m,required:$,additionalProperties:!1},execute:async(s,r)=>{try{if(M(r),Object.keys(s).some(l=>!Object.hasOwn(m,l)))throw new o("Unsupported vault feature argument.");let A=i==="netnet"?g[0]:g.find(l=>typeof s.vault=="string"&&I(l.vault,s.vault));if(!A)throw new o("Choose a current vault returned by the project list tool.");let{vault:n,asset:a}=A,b={...s};if(delete b.vault,e==="details")return L(t,`${i}_details`,n,a).execute(b,r);if(e==="manage")return N(t,`${i}_manage`,n,a).execute(b,r);if(e==="analytics")return i==="longbow"&&s.view==="published_apy"?U(t,n,a,b):i==="longbow"&&s.view==="apy"?K(t,n,a,b):{...await T(t,`${i}_analytics`,n).execute(b,r),asset:{...a,address:q(a.address)},shareToken:{address:n,symbol:`${i} shares`,decimals:18,chainId:y}};if(e==="in_kind_exit")return z(t,n,a,s,r);let f=t.clientFor(y);if(await f.getChainId()!==y)throw new o("Vault actions require chain 4663.");let[Q,X,Y]=await Promise.all([f.readContract({address:n,abi:w,functionName:"asset"}),f.readContract({address:n,abi:w,functionName:"decimals"}),f.readContract({address:a.address,abi:j,functionName:"decimals"})]);if(q(Q)!==q(a.address)||X!==18||Y!==a.decimals)throw new o("Vault metadata does not match the pinned asset and shares.");let E=e==="force_exit"?await f.readContract({address:n,abi:w,functionName:"balanceOf",args:[r]}):void 0;if(e==="force_exit"){let l=await R(t,f,n,r,E,F(s.maxPenaltyAssets),a),C=S(s.minAmountOut),p=[l.tx],v=await t.preview(p,r);return W(v.changes,n,E,C,a),{txs:p,preview:v,summary:`${H(l.plan,a.symbol)} ${v.summary}`}}let d=e==="mint",x=e==="redeem",c=S(d||x?s.shares:s.amount),_=await f.readContract({address:n,abi:w,functionName:d?"previewMint":x?"previewRedeem":"previewWithdraw",args:[c]});if(_<=0n||d&&_>S(s.maxAssets))throw new o("Vault quote is zero or exceeds maxAssets.");let V=d?void 0:await f.readContract({address:n,abi:w,functionName:"balanceOf",args:[r]});if(!d&&(x?c:_)>V)throw new o("The wallet share balance cannot cover this exit.");let Z=d?P({abi:w,functionName:"mint",args:[c,r]}):x?P({abi:w,functionName:"redeem",args:[c,r,r]}):P({abi:w,functionName:"withdraw",args:[c,r,r]}),B=`${e} ${c} ${d||x?"18-decimal share":`${a.decimals}-decimal ${a.symbol}`} base units on ${n}; beneficiary ${r}.`,D=[...d?[t.approval(a.address,n,_.toString(),y)]:[],t.unsignedTx({to:n,data:Z,value:"0",chainId:y,description:B})],O=await t.preview(D,r),h=(l,C)=>O.changes.filter(p=>p.token.chainId===y&&I(p.token.address,l)).reduce((p,v)=>{if(v.token.decimals!==C||!/^-?\d+$/.test(v.amount))throw new o("Invalid vault preview metadata.");return p+BigInt(v.amount)},0n);if(d?h(a.address,a.decimals)!==-_||h(n,18)!==c:x?h(n,18)!==-c||h(a.address,a.decimals)<=0n:h(a.address,a.decimals)!==c||-h(n,18)<=0n||-h(n,18)>V)throw new o("Vault preview does not match the requested amount and beneficiary.");return{txs:D,preview:O,summary:`${B} Counterpart quote ${_} base units. Mint approval is exact; accrual may require a fresh quote. Standard ERC-4626 calls encode no minimum receipt. ${O.summary}`}}catch(A){throw new o(t.plainError(A))}}}})}export{le as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as A}from"./
|
|
1
|
+
import{a as A}from"./SSTROLQM.js";import{a,b as g,c as b,e as w,f as x,g as h}from"./3NDVXEBR.js";import{a as r}from"./UWOFA6GV.js";import{c as y}from"./73N3TOJL.js";import{a as m}from"./G6HCV67X.js";import{a as i}from"./5YS5V2LK.js";import{encodeAbiParameters as S,encodeFunctionData as B,encodePacked as T,erc20Abi as I,getAddress as q,parseAbi as C,parseAbiParameters as N,zeroAddress as R}from"viem";var O=q("0x0000ffffbe8efe702c8703ae3477ff5de3d319c0"),$=N("(address currency,address tokensRecipient,address fundsRecipient,uint64 startBlock,uint64 endBlock,uint64 claimBlock,uint256 tickSpacing,address validationHook,uint256 floorPrice,uint128 requiredCurrencyRaised,bytes auctionStepsData)"),P=C(["function create(address token,uint256 amount,bytes configData,bytes32 salt) returns (address)","function getAddress(address token,uint256 amount,bytes configData,bytes32 salt,address sender) view returns (address)"]),Q=C(["function distributeToken(address token,(address strategy,uint128 amount,bytes configData) distribution,bytes32 salt) payable"]),v={token:y,amount:r(),currency:y,startBlock:r(),endBlock:r(),claimBlock:r(),tickSpacing:r(),floorPrice:r(),requiredCurrencyRaised:r(),salt:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},steps:{type:"array",minItems:1,maxItems:100,items:{type:"object",additionalProperties:!1,required:["mps","duration"],properties:{mps:r(),duration:r()}}}};function D(e,t){let s=a(e.startBlock,"startBlock",64),o=a(e.endBlock,"endBlock",64),c=a(e.claimBlock,"claimBlock",64);if(o<=s||c<o)throw new i("Auction needs startBlock < endBlock <= claimBlock.");if(!Array.isArray(e.steps)||e.steps.length<1||e.steps.length>100)throw new i("Provide 1 to 100 issuance steps.");let u="0x",p=0n,l=0n;for(let d of e.steps){if(!d||typeof d!="object"||Array.isArray(d))throw new i("Each step requires mps and duration decimal strings.");h(d,["mps","duration"]);let n=d,k=a(n.mps,"mps",24,!0),f=a(n.duration,"duration",40);u=`${u}${T(["uint24","uint40"],[Number(k),Number(f)]).slice(2)}`,l+=k*f,p+=f}if(l!==10000000n||p!==o-s)throw new i("Issuance must total exactly 10000000 MPS and its durations must equal endBlock - startBlock.");return S($,[{currency:b(e.currency),tokensRecipient:t,fundsRecipient:t,startBlock:s,endBlock:o,claimBlock:c,tickSpacing:a(e.tickSpacing,"tickSpacing"),validationHook:R,floorPrice:a(e.floorPrice,"floorPrice"),requiredCurrencyRaised:a(e.requiredCurrencyRaised??"0","requiredCurrencyRaised",128,!0),auctionStepsData:u}])}function U(e){return{tools:[{name:"uniswap_create_auction",inputSchema:{type:"object",additionalProperties:!1,required:["token","amount","currency","startBlock","endBlock","claimBlock","tickSpacing","floorPrice","steps","salt"],properties:v},async execute(t,s){h(t,Object.keys(v));let o=g(t.token),c=a(t.amount,"amount",128);if(o===R||o===b(t.currency))throw new i("Auction sale token must be an ERC-20 distinct from its payment currency.");let u=D(t,s);if(typeof t.salt!="string"||!/^0x[0-9a-fA-F]{64}$/.test(t.salt))throw new i("Provide a 32-byte deployment salt.");let p=t.salt,l=e.clientFor(m),d=await l.getBlockNumber();if(BigInt(String(t.startBlock))<=d)throw new i("Choose a future auction startBlock with time for confirmation and approvals.");let n=await l.readContract({address:A,abi:P,functionName:"getAddress",args:[o,c,u,p,s]});if((await l.getCode({address:n})??"0x")!=="0x")throw new i("This auction already exists; choose a fresh salt or configuration.");let k=await w(e,o),f=[e.unsignedTx({to:A,data:B({abi:P,functionName:"create",args:[o,c,u,p]}),value:"0",chainId:m,description:`Create CCA ${n}; proceeds and unsold tokens go to ${s}.`}),e.unsignedTx({to:o,data:B({abi:I,functionName:"transfer",args:[n,c]}),value:"0",chainId:m,description:`Fund the factory-predicted auction ${n} with exactly ${c} base units of ${o}.`}),e.unsignedTx({to:n,data:B({abi:C(["function onTokensReceived()"]),functionName:"onTokensReceived"}),value:"0",chainId:m,description:`Activate CCA ${n} after its sale tokens arrive.`})];return{...await x(e,f,s,"Create/fund/activate a standalone CCA in three separately confirmed transactions, not an LBP-managed liquidity launch. If interrupted, inspect the predicted address and journal before recovery; do not transfer tokens twice. Raw prices are payment-base-units per sale-token-base-unit in Q96. No validation hook or off-chain signature; all proceeds and unsold tokens go to the signing wallet."),auction:n,sale:{token:k,amount:c.toString()}}}}]}}export{O as a,$ as b,P as c,Q as d,D as e,U as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as I}from"./U3F6DDML.js";import{c as k}from"./PZHR4ITH.js";import{g as S}from"./DCTUYDWF.js";import{a as $}from"./AAGDMH54.js";import{a as U}from"./LQUDJCAR.js";import{c as G}from"./NU4K3TEZ.js";import{a as b}from"./UFS2RVEZ.js";import{b as E}from"./AXYOJBX6.js";import{a as h}from"./6IM6A5VA.js";import{a as D}from"./UWOFA6GV.js";import{g as y,n as C}from"./73N3TOJL.js";import{a as s,d as P,i as w}from"./G6HCV67X.js";import{a as m}from"./5YS5V2LK.js";import{encodeFunctionData as v,parseAbi as j}from"viem";var a=w[s].vaults.netnet.address,d={address:w[s].tokens.USDG.address,chainId:s,decimals:P,symbol:"USDG"},N={address:a,chainId:s,decimals:18,symbol:"nnUSDG"},o=j(["function asset() view returns (address)","function decimals() view returns (uint8)","function totalAssets() view returns (uint256)","function balanceOf(address owner) view returns (uint256)","function convertToAssets(uint256 shares) view returns (uint256)","function deposit(uint256 assets,address receiver) returns (uint256 shares)","function withdraw(uint256 assets,address receiver,address owner) returns (uint256 shares)","function redeem(uint256 shares,address receiver,address owner) returns (uint256 assets)"]),_=D("Positive USDG amount in integer base units (6 decimals)."),O="Preview amounts are estimates; these ERC-4626 calls have no on-chain minimum output argument. No transaction was sent.";function M(e){return C(e,"Amount must be positive and fit in uint256.",{notString:"Provide an integer amount string in base units.",positive:!0})}function g(e,f){if(Object.keys(e).some(l=>!f.includes(l)))throw new m("Unsupported NetNet argument.")}var q=e=>{async function f(t){try{return await t()}catch(n){throw new m(e.plainError(n))}}async function l(){let t=e.clientFor(s);if(await t.getChainId()!==s)throw new m("NetNet requires chain 4663.");let[n,r]=await Promise.all([t.readContract({address:a,abi:o,functionName:"asset"}),t.readContract({address:a,abi:o,functionName:"decimals"})]);if(!y(n,d.address))throw new m("NetNet does not report the pinned USDG asset.");if(r!==N.decimals)throw new m("NetNet share decimals do not match the pinned metadata.");return t}async function A(t,n,r){let i=await e.preview(t,n),p=i.changes.map(({token:u,amount:c})=>{let T=c.startsWith("-");return`${T?"-":"+"}${e.formatAmount(T?c.slice(1):c,u.decimals)} ${u.symbol}`}).join(", ");return{txs:t,preview:i,summary:`${r} ${i.summary} ${p?`Estimated changes: ${p}. `:""}${O}`}}async function R(t){return f(async()=>{h(t);let n=await l(),r=await n.readContract({address:a,abi:o,functionName:"balanceOf",args:[t]});if(r===0n)return[];let i=await n.readContract({address:a,abi:o,functionName:"convertToAssets",args:[r]});return[{module:"netnet",id:`${s}:${a}`,chainId:s,assets:[{token:{...d},amount:i.toString()}],description:`${e.formatAmount(r.toString(),N.decimals)} nnUSDG shares in NetNet Credit (${a}); underlying USDG is an estimate, not a liquidity guarantee.`}]})}return{positions:R,tools:[{name:"netnet_list",inputSchema:{type:"object",properties:{},additionalProperties:!1},execute:t=>f(async()=>{g(t,[]);let r=await(await l()).readContract({address:a,abi:o,functionName:"totalAssets"});return[{address:a,name:"NetNet Credit",chainId:s,asset:{...d},shares:{...N},totalAssets:{token:{...d},amount:r.toString()}}]})},{name:"netnet_deposit",inputSchema:{type:"object",properties:{amount:_},required:["amount"],additionalProperties:!1},execute:(t,n)=>f(async()=>{g(t,["amount"]),h(n);let r=M(t.amount);await l();let i=[e.approval(d.address,a,r.toString(),s),e.unsignedTx({to:a,data:v({abi:o,functionName:"deposit",args:[r,n]}),value:"0",chainId:s,description:`Deposit ${e.formatAmount(r.toString(),d.decimals)} USDG into NetNet Credit.`})];return A(i,n,"Approve the exact USDG amount, then deposit into NetNet Credit.")})},{name:"netnet_withdraw",inputSchema:{type:"object",properties:{amount:{anyOf:[_,{const:"max",description:"Redeem the fresh full nnUSDG share balance."}]}},required:["amount"],additionalProperties:!1},execute:(t,n)=>f(async()=>{g(t,["amount"]),h(n);let r=t.amount==="max"?void 0:M(t.amount),i=await l(),p,u;if(r===void 0){let c=await i.readContract({address:a,abi:o,functionName:"balanceOf",args:[n]});if(c===0n)throw new m("This wallet has no NetNet shares to redeem.");p=v({abi:o,functionName:"redeem",args:[c,n,n]}),u=`Redeem all ${e.formatAmount(c.toString(),N.decimals)} nnUSDG shares for USDG.`}else p=v({abi:o,functionName:"withdraw",args:[r,n,n]}),u=`Withdraw ${e.formatAmount(r.toString(),d.decimals)} USDG from NetNet Credit (unmeasured on the recorded fork; full exit uses amount "max" redeem).`;return A([e.unsignedTx({to:a,data:p,value:"0",chainId:s,description:u})],n,u)})}]}};function ie(e){return E("netnet",[q(e),S(e),k(e),G(e),$(e),U(e),I(e),{tools:b(e,"netnet",[{vault:a,asset:d}])}])}export{q as a,ie as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u,r=/\b(?:unsafe|safe|safety|risks?|risky|recommend\w*|buy\w*)\b/i,i=/(?:[a-z][a-z0-9+.-]*:\/\/|(?:https?|ftp|file|mailto|javascript|data):|www\.|\/\/|\b[a-z0-9-]+(?:\.[a-z0-9-]+)+\b)/i,a="HEY Research Lab context unavailable",o="Project names this contract",c="Builder evidence, not a trading signal.",E="Not tracked by HEY Research Lab yet";function s(t,e){return typeof t=="string"&&!!t.trim()&&t.length<=e&&!n.test(t)&&!/[<>[\]`]/.test(t)&&!r.test(t)&&!i.test(t)}function p(t,e){return!s(t,80)||!s(e,300)?a:`HEY Research Lab: ${t}. ${e}`}export{o as a,c as b,E as c,s as d,p as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as s}from"./
|
|
1
|
+
import{b as s}from"./NMYGNJIJ.js";import{a as o,c as t}from"./GGUEKSR4.js";import{getAddress as i}from"viem";var u=new Set(["priors_status",...s,...t.filter(r=>r.read).map(r=>r.name),"priors_ethos_status","priors_request_borrow","priors_request_repay","priors_request_stock","priors_request_backing","priors_pt_quote","priors_pt_position","priors_stock_quote","priors_savings_liquidity","priors_market_origin","priors_market_pins","priors_capabilities"]),p=new Set(["priors_sign_consent",...t.filter(r=>r.consentRoot).map(r=>r.name)]),d=new Set([...p,"priors_starter_line"]),R=new Set([...t.filter(r=>!r.read).map(r=>r.name),"priors_root_offer","priors_autopay_on","priors_autopay_off","priors_pt_buy","priors_pt_sell","priors_pt_redeem","priors_savings_force_withdraw","priors_stock_swap","priors_market_clear_bid_budget","priors_market_revoke_nft","priors_x_link"]);function S(r){let _=t.find(e=>e.name===r);return _?[o[_.contract],..._.approval==="bid"?[o.bidSpender]:[]]:r==="priors_root_offer"?[o.pool]:r==="priors_autopay_on"||r==="priors_autopay_off"?[o.autopay]:r==="priors_savings_force_withdraw"?[o.savings]:r==="priors_stock_swap"?[i("0xCaf681a66D020601342297493863E78C959E5cb2"),i("0x7Cd4E04E433E69e588728c86A3832753B5F846d4")]:r==="priors_pt_buy"||r==="priors_pt_sell"||r==="priors_pt_redeem"?[i("0x888888888889758F76e7103c6CbF23ABbF58F946")]:r==="priors_market_clear_bid_budget"?[o.bidSpender]:r==="priors_market_revoke_nft"?[o.registry,"0x0000000000000000000000000000000000000000"]:r==="priors_x_link"?[o.registry]:[]}export{u as a,p as b,d as c,R as d,S as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v}from"./UWOFA6GV.js";import{c as b,d as S,i as D,m as P,n as O}from"./73N3TOJL.js";import{a as l}from"./
|
|
1
|
+
import{a as v}from"./UWOFA6GV.js";import{c as b,d as S,i as D,m as P,n as O}from"./73N3TOJL.js";import{a as l}from"./G6HCV67X.js";import{a as d}from"./5YS5V2LK.js";import{encodeFunctionData as $,erc20Abi as B,getAddress as F,parseAbi as U}from"viem";var _={source:"https://github.com/beefyfinance/beefy-v2/blob/main/src/config/promos/chain/robinhood.json",observedAt:"2026-10-31",version:2,boosts:[{id:"moo_alandale-cow-robinhood-weth-shop-vault",address:"0xdC955E855148bE11621a74A5B4588846558215d1",token:"0xEBe70034de92614ebe06Cde98C12257f9397dC0e",vaultId:"alandale-cow-robinhood-weth-shop-vault"},{id:"moo_alandale-cow-robinhood-usdg-net-vault",address:"0x3bB573076462ab4E3De4542cFDAa4f36F0Ce082d",token:"0x857b3971E8038a8f8E2C0Da797145447eFbf6b86",vaultId:"alandale-cow-robinhood-usdg-net-vault"},{id:"moo_alandale-cow-robinhood-weth-usdg-vault",address:"0x13ec60CcFFD2cf989912CCBC038D618d3F56a30E",token:"0x4ED469Ac0080bE3CD192530D482E4d321823e743",vaultId:"alandale-cow-robinhood-weth-usdg-vault"},{id:"moo_alandale-cow-robinhood-weth-lute-vault",address:"0xC5ff71a8754c9A9FC0c27EE297025Ea7eEbDD19d",token:"0xd4A452bB077618b931603DbcB60ea43c05eBEa45",vaultId:"alandale-cow-robinhood-weth-lute-vault"},{id:"moo_alandale-cow-robinhood-usdg-lute-vault",address:"0x83a074A41c06c07631e284463ea2bfc3d2f674c5",token:"0xe50D89C43D0D13eE1439Bb5E94876A1163a26434",vaultId:"alandale-cow-robinhood-usdg-lute-vault"},{id:"moo_alandale-cow-robinhood-weth-spy-vault",address:"0xcdDa7830A6F034d66a46919f3D132f53A56a356d",token:"0x87673A619Fc4F3Fc08068A0BB04f60aA2D04ca62",vaultId:"alandale-cow-robinhood-weth-spy-vault"}]};var x=_.boosts.map(c=>({...c,address:F(c.address.toLowerCase()),token:F(c.token.toLowerCase())})),H=["beefy_boost","beefy_boost_manage"],R=U(["function stakedToken() view returns(address)","function owner() view returns(address)","function whitelisted(address) view returns(bool)","function earned(address) view returns(address[],uint256[])","function stake(uint256)","function withdraw(uint256)","function getReward()","function exit()","function notifyRewardAmount(address,uint256,uint256)","function removeReward(address,address)","function rescueTokens(address,address)","function setWhitelist(address,bool)","function transferOwnership(address)","function renounceOwnership()"]);function f(c){return D(c,"Provide an address.",S)}function I(c){return P(c,"Invalid Beefy reward-pool integer.")}function C(c){return O(c,"Amount must be positive and fit in uint256.",{notString:"Provide a positive base-unit integer string.",positive:!0})}var V=c=>{async function k(e){try{return await e()}catch(o){throw new d(c.plainError(o))}}function A(e,o){if(e.chainId!==void 0&&e.chainId!==l)throw new d("Beefy requires chain 4663.");for(let n of Object.keys(e))if(!["chainId",...o].includes(n))throw new d(`Unsupported Beefy input: ${n}.`)}function T(e){let o=x.find(n=>n.address===f(e.boost));if(!o)throw new d("Choose a pinned Robinhood Beefy v2 boost from beefy_boosts.");return o}async function y(){let e=c.clientFor(l);if(await e.getChainId()!==l)throw new d("The Beefy endpoint must report chain 4663.");let o=I(await e.getBlockNumber()),n=(s,i,r=[])=>e.readContract({address:s,abi:R,functionName:i,args:r,blockNumber:o}),t=async(s,i)=>I(await e.readContract({address:s,abi:B,functionName:"balanceOf",args:[i],blockNumber:o}));async function a(s){let[i,r]=await Promise.all([e.readContract({address:s,abi:B,functionName:"symbol",blockNumber:o}),e.readContract({address:s,abi:B,functionName:"decimals",blockNumber:o})]);if(typeof i!="string"||!i.trim()||typeof r!="number"||!Number.isInteger(r)||r<0||r>255)throw new d("Invalid Beefy boost token metadata.");return{address:s,symbol:i,decimals:r,chainId:l}}async function u(s,i){if(f(await n(s.address,"stakedToken"))!==s.token)throw new d("The Beefy boost staked token no longer matches its pinned configuration.");let r=await n(s.address,"earned",[i]);if(!Array.isArray(r)||r.length!==2||!Array.isArray(r[0])||!Array.isArray(r[1])||r[0].length!==r[1].length||r[0].length>100)throw new d("Invalid Beefy boost rewards.");let w=r[0].map(f);if(new Set(w).size!==w.length)throw new d("Duplicate Beefy boost reward tokens.");let p=await Promise.all(w.map(async(h,g)=>({token:await a(h),amount:I(r[1][g]).toString()})));return{id:s.id,boost:s.address,vaultId:s.vaultId,staked:{token:await a(s.token),amount:(await t(s.address,i)).toString()},rewards:p,block:o.toString(),chainId:l,source:_.source}}return{read:n,balance:t,token:a,pool:u,blockNumber:o}}function m(e,o,n=[]){return c.unsignedTx({to:e,data:$({abi:R,functionName:o,args:n}),value:"0",chainId:l,description:`Beefy reward pool: ${o}.`})}async function E(e,o,n,t){return{txs:e,inputs:t,preview:await c.preview(e,o),summary:n}}return{tools:[{name:"beefy_boosts",inputSchema:{type:"object",properties:{chainId:{const:l}},additionalProperties:!1},execute:(e,o)=>k(async()=>{A(e,[]),o=f(o);let n=await y(),t=[];for(let a of x)t.push(await n.pool(a,o));return{boosts:t,summary:"Pinned Robinhood v2 reward pools. Staked moo receipts keep their underlying vault exposure. Earned amounts are estimates; inspect claim preview. Boost receipt acquisition depends on the corresponding vault adapter."}})},{name:"beefy_boost",inputSchema:{type:"object",properties:{boost:b,action:{enum:["stake","withdraw","claim","exit"]},amount:{anyOf:[v(),{const:"all"}]},chainId:{const:l}},required:["boost","action"],additionalProperties:!1},execute:(e,o)=>k(async()=>{let n=String(e.action);if(!["stake","withdraw","claim","exit"].includes(n))throw new d("Choose stake, withdraw, claim or exit.");A(e,["boost","action",...["stake","withdraw"].includes(n)?["amount"]:[]]),o=f(o);let t=T(e),a=await y();await a.pool(t,o);let u,s=[];if(n==="stake"||n==="withdraw"){let i=n==="stake"?t.token:t.address,r=await a.balance(i,o),w=e.amount==="all"?r:C(e.amount);if(w===0n||w>r)throw new d("Provide a positive amount no greater than your current Beefy boost input balance.");s=[{token:i,amount:w.toString()}],u=[...n==="stake"?[c.approval(t.token,t.address,w.toString(),l)]:[],m(t.address,n,[w])]}else n==="exit"&&(s=[{token:t.address,amount:(await a.balance(t.address,o)).toString()}]),u=[m(t.address,n==="claim"?"getReward":"exit")];return E(u,o,`${n} Beefy boost ${t.id}. Withdraw returns moo receipts; exit also claims rewards. Redeem moo receipts with the matching supported vault adapter afterward. No output amount is guaranteed by these calls.`,s)})},{name:"beefy_boost_manage",inputSchema:{type:"object",properties:{boost:b,action:{enum:["notify_reward","remove_reward","rescue_tokens","set_manager","transfer_ownership","renounce_ownership"]},token:b,amount:v(),duration:v(),recipient:b,manager:b,enabled:{type:"boolean"},chainId:{const:l}},required:["boost","action"],additionalProperties:!1},execute:(e,o)=>k(async()=>{let n={notify_reward:["token","amount","duration"],remove_reward:["token","recipient"],rescue_tokens:["token","recipient"],set_manager:["manager","enabled"],transfer_ownership:["recipient"],renounce_ownership:[]},t=String(e.action);if(!Object.hasOwn(n,t))throw new d("Choose a documented Beefy reward-pool management action.");A(e,["boost","action",...n[t]]),o=f(o);let a=T(e),u=await y();if(await u.pool(a,o),!(t==="notify_reward"?await u.read(a.address,"whitelisted",[o])===!0:f(await u.read(a.address,"owner"))===o))throw new d("This wallet does not hold the required Beefy reward-pool owner or manager role.");let i=[],r=[];if(t==="notify_reward"){let p=f(e.token),h=C(e.amount),g=C(e.duration);if(p===a.token||g<3600n)throw new d("Reward token must differ from the stake token and duration must be at least 3600 seconds.");if(await u.balance(p,o)<h)throw new d("Insufficient reward token balance.");r.push({token:p,amount:h.toString()}),i.push(c.approval(p,a.address,h.toString(),l),m(a.address,"notifyRewardAmount",[p,h,g]))}else if(t==="remove_reward"||t==="rescue_tokens")i.push(m(a.address,t==="remove_reward"?"removeReward":"rescueTokens",[f(e.token),f(e.recipient)]));else if(t==="set_manager"){if(typeof e.enabled!="boolean")throw new d("Provide a boolean enabled value.");i.push(m(a.address,"setWhitelist",[f(e.manager),e.enabled]))}else t==="transfer_ownership"?i.push(m(a.address,"transferOwnership",[f(e.recipient)])):i.push(m(a.address,"renounceOwnership"));let w=t==="remove_reward"?" Removing this reward discards all unclaimed entitlements for that token.":t==="renounce_ownership"?" Renouncing ownership permanently gives up owner administration.":"";return E(i,o,`Beefy owner/manager action ${t} on ${a.address}.${w} Review the exact calldata and preview before human confirmation.`,r)})}],positions:e=>k(async()=>{e=f(e);let o=await y(),n=[];for(let t of x){let a=await o.pool(t,e);a.staked.amount==="0"&&a.rewards.every(u=>u.amount==="0")||n.push({module:"beefy",id:t.address,chainId:l,assets:[a.staked,...a.rewards.filter(u=>u.amount!=="0")],description:`${t.id}: moo receipt stake and estimated claimable rewards at block ${o.blockNumber}. Unstake/exit before redeeming moo receipts.`})}return n})}};export{x as a,H as b,R as c,V as d};
|